summaryrefslogtreecommitdiff
path: root/libavcodec/shorten.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-03-05 15:13:04 +0100
committerLuca Barbato <lu_zero@gentoo.org>2013-03-06 01:04:01 +0100
commitc10da30d8426a1f681d99a780b6e311f7fb4e5c5 (patch)
treecab2f2cad2344302ef4e78d95fc9b726058e85ed /libavcodec/shorten.c
parent02055b6d40d0cff867a9e41cad48edcaf6e10f2f (diff)
shorten: set invalid channels count to 0
Prevent the loop shorten_decode_close from writing and freeing out of the array boundary. Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Diffstat (limited to 'libavcodec/shorten.c')
-rw-r--r--libavcodec/shorten.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libavcodec/shorten.c b/libavcodec/shorten.c
index e678ee8e6a..d99877bb02 100644
--- a/libavcodec/shorten.c
+++ b/libavcodec/shorten.c
@@ -341,6 +341,7 @@ static int read_header(ShortenContext *s)
s->channels = get_uint(s, CHANSIZE);
if (s->channels <= 0 || s->channels > MAX_CHANNELS) {
av_log(s->avctx, AV_LOG_ERROR, "too many channels: %d\n", s->channels);
+ s->channels = 0;
return -1;
}
s->avctx->channels = s->channels;