summaryrefslogtreecommitdiffstats
path: root/libavcodec/truemotion1.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-03-02 21:36:42 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-03-02 21:36:42 +0100
commite7b43e8e84e48fccf64cdc62430cb8b5c69e804c (patch)
treea92f58e624d84334319d8b95f61af8a20f10bee9 /libavcodec/truemotion1.c
parenta3f5ee297a7cf9bf21646ec4858d614f36248ff7 (diff)
downloadffmpeg-streaming-e7b43e8e84e48fccf64cdc62430cb8b5c69e804c.zip
ffmpeg-streaming-e7b43e8e84e48fccf64cdc62430cb8b5c69e804c.tar.gz
truemotion1: Check input buffer size against header size.
Fixes overread. Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/truemotion1.c')
-rw-r--r--libavcodec/truemotion1.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/truemotion1.c b/libavcodec/truemotion1.c
index ccebef5..767eced 100644
--- a/libavcodec/truemotion1.c
+++ b/libavcodec/truemotion1.c
@@ -314,7 +314,7 @@ static int truemotion1_decode_header(TrueMotion1Context *s)
const uint8_t *sel_vector_table;
header.header_size = ((s->buf[0] >> 5) | (s->buf[0] << 3)) & 0x7f;
- if (s->buf[0] < 0x10)
+ if (s->buf[0] < 0x10 || header.header_size >= s->size)
{
av_log(s->avctx, AV_LOG_ERROR, "invalid header size (%d)\n", s->buf[0]);
return -1;
OpenPOWER on IntegriCloud