avcodec/movtextdec: run mov_text_cleanup() before overwriting pointers
authorMichael Niedermayer <michael@niedermayer.cc>
Wed, 8 Mar 2017 21:54:10 +0000 (22:54 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Thu, 9 Mar 2017 22:28:10 +0000 (23:28 +0100)
Fixes: memleak
Fixes: 741/clusterfuzz-testcase-586996200452915

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

index 6de1500..fb5085c 100644 (file)
@@ -459,6 +459,8 @@ static int mov_text_decode_frame(AVCodecContext *avctx,
     end = ptr + FFMIN(2 + text_length, avpkt->size);
     ptr += 2;
 
+    mov_text_cleanup(m);
+
     tsmb_size = 0;
     m->tracksize = 2 + text_length;
     m->style_entries = 0;