diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-05-28 17:04:38 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-06-09 21:06:22 +0200 |
commit | 1285fe5530437132a9d68d336d08b21c0e4ad58c (patch) | |
tree | 667062edd63577d2dd2b602ef4741b24f20347a0 | |
parent | 0aefcb6aa86b80729b2475d192940801892d97ff (diff) | |
download | ffmpeg-1285fe5530437132a9d68d336d08b21c0e4ad58c.tar.gz |
xan: fix out of array read
Fixes ticket1360
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 01900fcc45e99ee4556e0a5d87ff57b2f150dad4)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/xan.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/xan.c b/libavcodec/xan.c index 17b994bd81..5341e0eb70 100644 --- a/libavcodec/xan.c +++ b/libavcodec/xan.c @@ -511,6 +511,10 @@ static int xan_decode_frame(AVCodecContext *avctx, int i; tag = bytestream_get_le32(&buf); size = bytestream_get_be32(&buf); + if(size < 0) { + av_log(avctx, AV_LOG_ERROR, "Invalid tag size %d\n", size); + return AVERROR_INVALIDDATA; + } size = FFMIN(size, buf_end - buf); switch (tag) { case PALT_TAG: |