avauddec: Fix crash on stop()

GstFFMpegAudDec.context can be nullptr if decoder got closed
without opening new context. Note that we don't need to clear
AVCodecContext.extradata there since avcodec_free_context()
will do clear the data if needed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7180>
This commit is contained in:
Seungha Yang 2024-07-16 20:49:13 +09:00
parent 3eec4703c6
commit 75d8dbc556

View file

@ -171,7 +171,6 @@ gst_ffmpegauddec_close (GstFFMpegAudDec * ffmpegdec)
GST_LOG_OBJECT (ffmpegdec, "closing libav codec");
gst_caps_replace (&ffmpegdec->last_caps, NULL);
av_freep (&ffmpegdec->context->extradata);
avcodec_free_context (&ffmpegdec->context);
}