v4l2videodec: Clear the input state pointer after unref
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Wed, 12 Mar 2014 16:56:18 +0000 (17:56 +0100)
committerNicolas Dufresne <nicolas.dufresne@collabora.com>
Thu, 8 May 2014 19:56:35 +0000 (15:56 -0400)
If caps are set again, we have a risk od returning from set_format with a
input_state pointing to dead memory. Clearing the pointer after unref fix
this issue.

sys/v4l2/gstv4l2videodec.c

index 2fc2763..ee5f167 100644 (file)
@@ -251,6 +251,7 @@ gst_v4l2_video_dec_set_format (GstVideoDecoder * decoder,
       goto done;
     }
     gst_video_codec_state_unref (self->input_state);
+    self->input_state = NULL;
 
     /* FIXME we probably need to do more work if pools are active */
   }