dshow:protect access to curbufsize to promote consistency
authorrogerdpack <rogerpack2005@gmail.com>
Sun, 19 Aug 2012 14:10:07 +0000 (08:10 -0600)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 20 Aug 2012 18:58:05 +0000 (20:58 +0200)
Signed-off-by: rogerdpack <rogerpack2005@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavdevice/dshow.c

index 0d1987b..ea6c21c 100644 (file)
@@ -207,11 +207,11 @@ callback(void *priv_data, int index, uint8_t *buf, int buf_size, int64_t time)
 
 //    dump_videohdr(s, vdhdr);
 
-    if(shall_we_drop(s))
-        return;
-
     WaitForSingleObject(ctx->mutex, INFINITE);
 
+    if(shall_we_drop(s))
+        goto fail;
+
     pktl_next = av_mallocz(sizeof(AVPacketList));
     if(!pktl_next)
         goto fail;