theoradec: Don't leak input state if a second type packet is received
authorSebastian Dröge <sebastian@centricular.com>
Fri, 23 Feb 2024 11:16:36 +0000 (13:16 +0200)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Fri, 23 Feb 2024 15:03:35 +0000 (15:03 +0000)
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6203>

subprojects/gst-plugins-base/ext/theora/gsttheoradec.c

index 3d65e02607ba5a48478c2bc1bd5148bc39b2f2ad..66e6edd1ebe31acc1b949ee67f8de42b6aa7eba9 100644 (file)
@@ -487,6 +487,8 @@ theora_handle_type_packet (GstTheoraDec * dec)
   }
 
   /* Create the output state */
+  if (dec->output_state)
+    gst_video_codec_state_unref (dec->output_state);
   dec->output_state = state =
       gst_video_decoder_set_output_state (GST_VIDEO_DECODER (dec), fmt,
       width, height, dec->input_state);