aboutsummaryrefslogtreecommitdiffstats
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-12 13:36:50 +0100
commit21d568be179c54a1596d1377b4da7fbe755bfe7f (patch)
tree5d7958a1fa4ce443ea1bd52700f6e193dd9fd924 /libavcodec/shorten.c
parent0cb3cab3431276c9339df91bfdbf30510d784a6c (diff)
downloadffmpeg-21d568be179c54a1596d1377b4da7fbe755bfe7f.tar.gz
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> CC: libav-stable@libav.org (cherry picked from commit c10da30d8426a1f681d99a780b6e311f7fb4e5c5)
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 1dc010f441..50fc506440 100644
--- a/libavcodec/shorten.c
+++ b/libavcodec/shorten.c
@@ -345,6 +345,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;