diff options
author | Anton Khirnov <anton@khirnov.net> | 2013-04-09 20:33:25 +0200 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2013-04-24 21:01:14 +0200 |
commit | c5084a17654963565975337ec1c2e90c4df288f4 (patch) | |
tree | 45bd1c0512de7fda61c4f51ec2ce1fc9a9a7818e /libavcodec | |
parent | 74753cf1a99b9ded5525a351ec536a3d5cb4c068 (diff) | |
download | ffmpeg-c5084a17654963565975337ec1c2e90c4df288f4.tar.gz |
rv10: check that extradata is large enough
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
(cherry picked from commit 01d376f598fe95478036f5d1e3e5e14ffe32d4bf)
Conflicts:
libavcodec/rv10.c
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/rv10.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/rv10.c b/libavcodec/rv10.c index 58604d1947..4f64ec29b3 100644 --- a/libavcodec/rv10.c +++ b/libavcodec/rv10.c @@ -341,6 +341,11 @@ static int rv20_decode_picture_header(MpegEncContext *s) f = get_bits(&s->gb, rpr_bits); if(f){ + if (s->avctx->extradata_size < 8 + 2 * f) { + av_log(s->avctx, AV_LOG_ERROR, "Extradata too small.\n"); + return AVERROR_INVALIDDATA; + } + new_w= 4*((uint8_t*)s->avctx->extradata)[6+2*f]; new_h= 4*((uint8_t*)s->avctx->extradata)[7+2*f]; }else{ |