[FFmpeg-cvslog] avfilter/lavfutils: Don't use uninitialized pointers for freeing

Andreas Rheinhardt git at videolan.org
Fri Sep 11 16:23:24 EEST 2020


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at gmail.com> | Thu Sep 10 15:36:11 2020 +0200| [3d1a9824b8e7f5ad52447cc2d60beffc9e66ff67] | committer: Andreas Rheinhardt

avfilter/lavfutils: Don't use uninitialized pointers for freeing

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 at gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3d1a9824b8e7f5ad52447cc2d60beffc9e66ff67
---

 libavfilter/lavfutils.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavfilter/lavfutils.c b/libavfilter/lavfutils.c
index db4b69b9f3..84dd4c0704 100644
--- a/libavfilter/lavfutils.c
+++ b/libavfilter/lavfutils.c
@@ -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;



More information about the ffmpeg-cvslog mailing list