aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-01-24 17:48:23 +0100
committerReinhard Tartler <siretart@tauware.de>2012-04-21 15:39:00 +0200
commit479869c499a28a0c19dfc355d6ffcd1d8c02720e (patch)
treeec852482a5cfbe3d061a086b065efb8a3a7f96a3
parentec4979e16e119e9ccb42b111008e74b9bc667428 (diff)
downloadffmpeg-479869c499a28a0c19dfc355d6ffcd1d8c02720e.tar.gz
dv: check stype
dv: check stype Fixes part1 of CVE-2011-3929 Possibly fixes part of CVE-2011-3936 Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Reviewed-by: Roman Shaposhnik <roman@shaposhnik.org> Signed-off-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: Alex Converse <alex.converse@gmail.com> (cherry picked from commit 635bcfccd439480003b74a665b5aa7c872c1ad6b) Signed-off-by: Reinhard Tartler <siretart@tauware.de> (cherry picked from commit bb737d381f6d6413899a0697f426fb082eac66fc) Signed-off-by: Reinhard Tartler <siretart@tauware.de> (cherry picked from commit 38421f27b3899a930552750fe1e0dffd45b71b8e) Signed-off-by: Reinhard Tartler <siretart@tauware.de>
-rw-r--r--libavformat/dv.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavformat/dv.c b/libavformat/dv.c
index 820c3b5cec..c650b5b52e 100644
--- a/libavformat/dv.c
+++ b/libavformat/dv.c
@@ -202,6 +202,12 @@ static int dv_extract_audio_info(DVDemuxContext* c, uint8_t* frame)
stype = (as_pack[3] & 0x1f); /* 0 - 2CH, 2 - 4CH, 3 - 8CH */
quant = as_pack[4] & 0x07; /* 0 - 16bit linear, 1 - 12bit nonlinear */
+ if (stype > 3) {
+ av_log(c->fctx, AV_LOG_ERROR, "stype %d is invalid\n", stype);
+ c->ach = 0;
+ return 0;
+ }
+
/* note: ach counts PAIRS of channels (i.e. stereo channels) */
ach = ((int[4]){ 1, 0, 2, 4})[stype];
if (ach == 1 && quant && freq == 2)