v4l2codecs: h264: Fix a memory leak on renegotiation

We only use this anchor when streaming, in which case output_state is
set and needs to get unreffed.
This is in line with how it is handled for all other codecs.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6127>
This commit is contained in:
Robert Mader 2024-02-14 22:11:51 +01:00
parent 22b7200d60
commit 6b024b50ab

View file

@ -367,10 +367,10 @@ gst_v4l2_codec_h264_dec_negotiate (GstVideoDecoder * decoder)
}
gst_caps_unref (caps);
done:
if (self->output_state)
gst_video_codec_state_unref (self->output_state);
done:
self->output_state =
gst_video_decoder_set_output_state (GST_VIDEO_DECODER (self),
self->vinfo.finfo->format, self->display_width,