aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/4xm.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-11-12 14:56:07 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-11-12 14:56:33 +0100
commitc433823750bf096187e70c22822431a7c0bb4202 (patch)
tree0625bd4166cb88b94e3792d385ebbbe82ee0089a /libavcodec/4xm.c
parentbe818df547c3b0ae4fadb50fd210139a8636706a (diff)
downloadffmpeg-c433823750bf096187e70c22822431a7c0bb4202.tar.gz
4xmdec: test version for cfrms, fix out of array accesses
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/4xm.c')
-rw-r--r--libavcodec/4xm.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/4xm.c b/libavcodec/4xm.c
index bbf6d902c0..bd70692273 100644
--- a/libavcodec/4xm.c
+++ b/libavcodec/4xm.c
@@ -811,6 +811,11 @@ static int decode_frame(AVCodecContext *avctx, void *data,
return AVERROR_INVALIDDATA;
}
+ if (f->version <= 1) {
+ av_log(f->avctx, AV_LOG_ERROR, "cfrm in version %d\n", f->version);
+ return AVERROR_INVALIDDATA;
+ }
+
for (i = 0; i < CFRAME_BUFFER_COUNT; i++)
if (f->cfrm[i].id && f->cfrm[i].id < avctx->frame_number)
av_log(f->avctx, AV_LOG_ERROR, "lost c frame %d\n",