[FFmpeg-devel,v2,3/8] avformat/mpc8: fix memleak when seek table too big

Submitted by Steven Liu on Oct. 10, 2019, 2:07 a.m.

Details

Message ID 20191010020756.30820-3-lq@chinaffmpeg.org
State New
Headers show

Commit Message

Steven Liu Oct. 10, 2019, 2:07 a.m.
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
---
 libavformat/mpc8.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Michael Niedermayer Oct. 11, 2019, 8:17 p.m.
On Thu, Oct 10, 2019 at 10:07:51AM +0800, Steven Liu wrote:
> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
> ---
>  libavformat/mpc8.c | 1 +
>  1 file changed, 1 insertion(+)

LGTM

thx

[...]

Patch hide | download patch | download mbox

diff --git a/libavformat/mpc8.c b/libavformat/mpc8.c
index 0eb879ffc0..e452cd6878 100644
--- a/libavformat/mpc8.c
+++ b/libavformat/mpc8.c
@@ -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);