avformat/mpc8: fix memleak when seek table too big
authorSteven Liu <lq@chinaffmpeg.org>
Thu, 10 Oct 2019 02:07:51 +0000 (10:07 +0800)
committerSteven Liu <lq@chinaffmpeg.org>
Mon, 28 Oct 2019 06:26:10 +0000 (14:26 +0800)
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
libavformat/mpc8.c

index 0eb879f..e452cd6 100644 (file)
@@ -168,6 +168,7 @@ static void mpc8_parse_seektable(AVFormatContext *s, int64_t off)
     size = gb_get_v(&gb);
     if(size > UINT_MAX/4 || size > c->samples/1152){
         av_log(s, AV_LOG_ERROR, "Seek table is too big\n");
+        av_free(buf);
         return;
     }
     seekd = get_bits(&gb, 4);