dvdec: check ipcm more completely, avoid assert failure.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
pull/8/head
Michael Niedermayer 12 years ago
parent 41ebbb3b04
commit 3669915e93
  1. 5
      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. */ * channels 0,1 and odd 2,3. */
ipcm = (sys->height == 720 && !(frame[1] & 0x0C)) ? 2 : 0; 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 each DIF channel */
for (chan = 0; chan < sys->n_difchan; chan++) { for (chan = 0; chan < sys->n_difchan; chan++) {
av_assert0(ipcm<4); av_assert0(ipcm<4);

Loading…
Cancel
Save