vp9dec: Fix segfault when a new caps is received
authorThiago Santos <thiagoss@osg.samsung.com>
Tue, 2 Sep 2014 03:55:17 +0000 (00:55 -0300)
committerThiago Santos <thiagoss@osg.samsung.com>
Tue, 2 Sep 2014 04:01:43 +0000 (01:01 -0300)
Remember to unref the output caps when a new caps event is received
as it should generate a new one based on the new caps.

https://bugzilla.gnome.org/show_bug.cgi?id=734266

ext/vpx/gstvp9dec.c

index e8d5941..6f0b585 100644 (file)
@@ -318,6 +318,11 @@ gst_vp9_dec_set_format (GstVideoDecoder * decoder, GstVideoCodecState * state)
     vpx_codec_destroy (&gst_vp9_dec->decoder);
   gst_vp9_dec->decoder_inited = FALSE;
 
+  if (gst_vp9_dec->output_state) {
+    gst_video_codec_state_unref (gst_vp9_dec->output_state);
+    gst_vp9_dec->output_state = NULL;
+  }
+
   if (gst_vp9_dec->input_state)
     gst_video_codec_state_unref (gst_vp9_dec->input_state);
   gst_vp9_dec->input_state = gst_video_codec_state_ref (state);