diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-06-09 15:03:04 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-06-09 15:04:12 +0200 |
commit | 1b7a4c93a9df169c776ee973100f659386dd49e5 (patch) | |
tree | 2a78a829dd33bd2d7fd782581ce56c707a7730b1 /libavcodec/bintext.c | |
parent | c61c8536ef42ebf9163da36609cb85562615b8ff (diff) | |
download | ffmpeg-1b7a4c93a9df169c776ee973100f659386dd49e5.tar.gz |
lavc/bintext: check extradata size
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/bintext.c')
-rw-r--r-- | libavcodec/bintext.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/bintext.c b/libavcodec/bintext.c index 463e4ac661..e4507e5b42 100644 --- a/libavcodec/bintext.c +++ b/libavcodec/bintext.c @@ -54,6 +54,11 @@ static av_cold int decode_init(AVCodecContext *avctx) s->font_height = p[0]; s->flags = p[1]; p += 2; + if(avctx->extradata_size < 2 + (!!(s->flags & BINTEXT_PALETTE))*3*16 + + (!!(s->flags & BINTEXT_FONT))*s->font_height*256) { + av_log(avctx, AV_LOG_ERROR, "not enough extradata\n"); + return AVERROR_INVALIDDATA; + } } else { s->font_height = 8; s->flags = 0; |