avviddec: Fix AVPacket leak

av_packet_unref() does not release allocated memory.
av_packet_free() is the correct free function.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6545>
This commit is contained in:
Seungha Yang 2024-04-05 02:28:53 +09:00 committed by Tim-Philipp Müller
parent 984b1f413a
commit ce4f0d5746

View file

@ -2277,10 +2277,10 @@ gst_ffmpegviddec_handle_frame (GstVideoDecoder * decoder,
GST_VIDEO_DECODER_STREAM_UNLOCK (ffmpegdec); GST_VIDEO_DECODER_STREAM_UNLOCK (ffmpegdec);
if (avcodec_send_packet (ffmpegdec->context, packet) < 0) { if (avcodec_send_packet (ffmpegdec->context, packet) < 0) {
GST_VIDEO_DECODER_STREAM_LOCK (ffmpegdec); GST_VIDEO_DECODER_STREAM_LOCK (ffmpegdec);
av_packet_unref (packet); av_packet_free (&packet);
goto send_packet_failed; goto send_packet_failed;
} }
av_packet_unref (packet); av_packet_free (&packet);
GST_VIDEO_DECODER_STREAM_LOCK (ffmpegdec); GST_VIDEO_DECODER_STREAM_LOCK (ffmpegdec);
do { do {