]> git.sesse.net Git - ffmpeg/commitdiff
avfilter/lavfutils: Don't use uninitialized pointers for freeing
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Thu, 10 Sep 2020 13:36:11 +0000 (15:36 +0200)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Fri, 11 Sep 2020 12:39:38 +0000 (14:39 +0200)
Happened on several error conditions, e.g. if there is just no decoder
for the format (like with svg images).

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavfilter/lavfutils.c

index db4b69b9f36d0a18e1531defd2851e869db894a8..84dd4c0704792f5a7a40c23376f0ff2d47ad3be7 100644 (file)
@@ -28,9 +28,9 @@ int ff_load_image(uint8_t *data[4], int linesize[4],
     AVInputFormat *iformat = NULL;
     AVFormatContext *format_ctx = NULL;
     AVCodec *codec;
-    AVCodecContext *codec_ctx;
+    AVCodecContext *codec_ctx = NULL;
     AVCodecParameters *par;
-    AVFrame *frame;
+    AVFrame *frame = NULL;
     int frame_decoded, ret = 0;
     AVPacket pkt;
     AVDictionary *opt=NULL;