From ee402df9a25d1f0e15247511f524c0b7df102a27 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Thu, 19 Apr 2012 21:46:51 +0200 Subject: mtvdec: check that the buf is large enough for probing Signed-off-by: Michael Niedermayer --- libavformat/mtv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libavformat/mtv.c') diff --git a/libavformat/mtv.c b/libavformat/mtv.c index 19b7793..2f7e5fd 100644 --- a/libavformat/mtv.c +++ b/libavformat/mtv.c @@ -57,7 +57,7 @@ static int mtv_probe(AVProbeData *p) return 0; /* Check for nonzero in bpp and (width|height) header fields */ - if(!(p->buf[51] && AV_RL16(&p->buf[52]) | AV_RL16(&p->buf[54]))) + if(p->buf_size < 57 || !(p->buf[51] && AV_RL16(&p->buf[52]) | AV_RL16(&p->buf[54]))) return 0; /* If width or height are 0 then imagesize header field should not */ -- cgit v1.1