diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-01-04 21:55:52 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-01-04 21:58:08 +0100 |
commit | ff7f198d7f9504f71676327be0be47661cfe39d6 (patch) | |
tree | b25766bf84d367454812f4242f6f46a58e240bf4 /libavcodec/vorbisdec.c | |
parent | f74ce3a60d6ef49080df85c44b54280357109f56 (diff) | |
download | ffmpeg-ff7f198d7f9504f71676327be0be47661cfe39d6.tar.gz |
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>
Diffstat (limited to 'libavcodec/vorbisdec.c')
-rw-r--r-- | libavcodec/vorbisdec.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libavcodec/vorbisdec.c b/libavcodec/vorbisdec.c index cc737e94b3..1bd7a0ba12 100644 --- a/libavcodec/vorbisdec.c +++ b/libavcodec/vorbisdec.c @@ -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"); return -1; } - ret = vorbis_residue_decode(vc, residue, ch, do_not_decode, ch_res_ptr, vlen, ch_left); - if (ret < 0) - return ret; + if (ch) { + ret = vorbis_residue_decode(vc, residue, ch, do_not_decode, ch_res_ptr, vlen, ch_left); + if (ret < 0) + return ret; + } ch_res_ptr += ch * vlen; ch_left -= ch; |