diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-05-28 17:04:38 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-06-09 20:37:36 +0200 |
commit | 7df0e309fd6e39384f9ed80103e3191049f0a280 (patch) | |
tree | 2275d4b85e09805b9a7eead0cd81b3ecd9a707a2 | |
parent | a4b329d6228ecad76299523cdbee16f37a8ca98b (diff) | |
download | ffmpeg-7df0e309fd6e39384f9ed80103e3191049f0a280.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 cfaca81e16..62bec83490 100644 --- a/libavcodec/xan.c +++ b/libavcodec/xan.c @@ -512,6 +512,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: |