aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-11-13 19:37:47 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-11-13 21:45:53 +0100
commit3669915e93b3df63034857534245c3f2575d78ff (patch)
tree24bc4bd94531acad73741f3d5bc60681c90071d6 /libavformat
parent41ebbb3b0462182a87f610fe6a48c6ed8acf5cd7 (diff)
downloadffmpeg-3669915e93b3df63034857534245c3f2575d78ff.tar.gz
dvdec: check ipcm more completely, avoid assert failure.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/dv.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/dv.c b/libavformat/dv.c
index f3d88e457c..a04735ac25 100644
--- a/libavformat/dv.c
+++ b/libavformat/dv.c
@@ -142,6 +142,11 @@ static int dv_extract_audio(uint8_t* frame, uint8_t* ppcm[4],
* channels 0,1 and odd 2,3. */
ipcm = (sys->height == 720 && !(frame[1] & 0x0C)) ? 2 : 0;
+ if (ipcm + sys->n_difchan > (quant == 1 ? 2 : 4)) {
+ av_log(NULL, AV_LOG_ERROR, "too many dv pcm frames\n");
+ return AVERROR_INVALIDDATA;
+ }
+
/* for each DIF channel */
for (chan = 0; chan < sys->n_difchan; chan++) {
av_assert0(ipcm<4);