diff mbox series

[FFmpeg-devel] avcodec/codec_par: always free side data in the destination AVCodecContext

Message ID 20230721011320.31747-1-jamrial@gmail.com
State Accepted
Commit d383ae43c266b160348db04f2fd17ccf30286784
Headers show
Series [FFmpeg-devel] avcodec/codec_par: always free side data in the destination AVCodecContext | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

James Almer July 21, 2023, 1:13 a.m. UTC
Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavcodec/codec_par.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavcodec/codec_par.c b/libavcodec/codec_par.c
index 775c187073..a38a475dc7 100644
--- a/libavcodec/codec_par.c
+++ b/libavcodec/codec_par.c
@@ -253,8 +253,8 @@  FF_ENABLE_DEPRECATION_WARNINGS
         break;
     }
 
+    av_freep(&codec->extradata);
     if (par->extradata) {
-        av_freep(&codec->extradata);
         codec->extradata = av_mallocz(par->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE);
         if (!codec->extradata)
             return AVERROR(ENOMEM);