1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00

vorbis: make sure ch is non zero before calling vorbis_residue_decode

This possibly makes part of the CVE-2011-3895 fix unneeded.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-01-04 21:55:52 +01:00
parent f74ce3a60d
commit ff7f198d7f

View File

@ -1575,9 +1575,11 @@ static int vorbis_parse_audio_packet(vorbis_context *vc)
av_log(vc->avccontext, AV_LOG_ERROR, "Too many channels in vorbis_floor_decode.\n"); av_log(vc->avccontext, AV_LOG_ERROR, "Too many channels in vorbis_floor_decode.\n");
return -1; return -1;
} }
ret = vorbis_residue_decode(vc, residue, ch, do_not_decode, ch_res_ptr, vlen, ch_left); if (ch) {
if (ret < 0) ret = vorbis_residue_decode(vc, residue, ch, do_not_decode, ch_res_ptr, vlen, ch_left);
return ret; if (ret < 0)
return ret;
}
ch_res_ptr += ch * vlen; ch_res_ptr += ch * vlen;
ch_left -= ch; ch_left -= ch;