aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-02-13 01:03:30 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-02-19 01:28:52 +0100
commit811a504c6bc2586a8ea5d52fbcfee94277123eb5 (patch)
tree2797edbff48979a2138d53eb20534030f87529c8 /libavcodec
parent75211f2b8cfb8b4a3f47c514e55585651eeb2767 (diff)
downloadffmpeg-811a504c6bc2586a8ea5d52fbcfee94277123eb5.tar.gz
shorten: dont leave invalid channel counts in the context.
Fixes freeing invalid addresses Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 4f1279154ee9baf2078241bf5619774970d18b25) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/shorten.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libavcodec/shorten.c b/libavcodec/shorten.c
index 8e66928db5..1d1f7eca07 100644
--- a/libavcodec/shorten.c
+++ b/libavcodec/shorten.c
@@ -343,6 +343,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 AVERROR_INVALIDDATA;
}
s->avctx->channels = s->channels;