summaryrefslogtreecommitdiff
path: root/libavcodec/apedec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-03-28 10:30:44 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-03-28 10:30:44 +0200
commit8db2935db0caa8efbef009994920ef6a20289496 (patch)
treecfae8d60e58407ca83b3797d716fa3408e8d0488 /libavcodec/apedec.c
parent7a5e5872493ac91af65357680cf03456d0a4f1ff (diff)
downloadffmpeg-8db2935db0caa8efbef009994920ef6a20289496.tar.gz
apedec: fix global array overread
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/apedec.c')
-rw-r--r--libavcodec/apedec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c
index 907f45faff..4d0801b708 100644
--- a/libavcodec/apedec.c
+++ b/libavcodec/apedec.c
@@ -217,7 +217,7 @@ static av_cold int ape_decode_init(AVCodecContext *avctx)
av_log(avctx, AV_LOG_DEBUG, "Compression Level: %d - Flags: %d\n",
s->compression_level, s->flags);
- if (s->compression_level % 1000 || s->compression_level > COMPRESSION_LEVEL_INSANE) {
+ if (s->compression_level % 1000 || s->compression_level > COMPRESSION_LEVEL_INSANE || !s->compression_level) {
av_log(avctx, AV_LOG_ERROR, "Incorrect compression level %d\n",
s->compression_level);
return AVERROR_INVALIDDATA;