avcodec/mjpegdec: Fix stereo3d memleak
authorMichael Niedermayer <michael@niedermayer.cc>
Sun, 17 Feb 2019 19:43:28 +0000 (20:43 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Mon, 25 Feb 2019 17:03:24 +0000 (18:03 +0100)
Fixes: 12937/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_THP_fuzzer-5714945346371584

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/mjpegdec.c

index 902b8eb..e82c185 100644 (file)
@@ -1903,6 +1903,7 @@ static int mjpeg_decode_app(MJpegDecodeContext *s)
         type   = get_bits(&s->gb, 8);
         len -= 4;
 
+        av_freep(&s->stereo3d);
         s->stereo3d = av_stereo3d_alloc();
         if (!s->stereo3d) {
             goto out;