GNOME Bugzilla – Bug 761399
rtspmedia: Missing lock in default_unsuspend, preroll_failed path
Last modified: 2016-04-14 17:42:53 UTC
The function 'default_unsuspend' in rtsp-media.c unlocks and locks the state_lock in the 'GST_RTSP_SUSPEND_MODE_RESET' case handler. But when 'wait_preroll' fails, it will jump to the 'preroll_failed' label. Where the state_lock is not locked again.
Created attachment 320178 [details] [review] rtsp-media: fix state_lock not locked again when preroll fails.
Comment on attachment 320178 [details] [review] rtsp-media: fix state_lock not locked again when preroll fails. Thanks for the patch, looks good. Could I persuade you to rewrite it as follows: add a gboolean preroll_ok so that the flow is: unlock() preroll_ok = wait_preroll() lock() if (!preroll_ok) goto fail; ? (I know we usually do unlocks and such also in the error code paths, but here it's easy to keep the locking pair in one place so it seems preferable to me to do that instead)
Created attachment 320251 [details] [review] rtsp-media: fix state_lock not locked again when preroll fails v2.
Thanks, pushed to master commit aea624b6f8b93d506eb7b1f8a8b9086ca552856f Author: Steven Hoving <sh@bigbrother.nl> Date: Tue Feb 2 09:01:51 2016 +0100 rtsp-media: fix state_lock not locked again when preroll fails https://bugzilla.gnome.org/show_bug.cgi?id=761399 and picked into 1.6 branch.