xan: fix out of array read

Fixes ticket1360

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 01900fcc45)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-05-28 17:04:38 +02:00
parent 0aefcb6aa8
commit 1285fe5530
1 changed files with 4 additions and 0 deletions

View File

@ -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: