vorbisdec: fix heap buffer overflow.

Found-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
pull/28/head
Michael Niedermayer 13 years ago
parent a6aa7e039a
commit 8cac86e091
  1. 2
      libavcodec/vorbisdec.c

@ -1411,7 +1411,7 @@ static av_always_inline int vorbis_residue_decode_internal(vorbis_context *vc,
} }
} else if (vr_type == 2) { } else if (vr_type == 2) {
unsigned voffs_div = FASTDIV(voffset, ch); unsigned voffs_div = ch == 1 ? voffset : FASTDIV(voffset, ch);
unsigned voffs_mod = voffset - voffs_div * ch; unsigned voffs_mod = voffset - voffs_div * ch;
for (k = 0; k < step; ++k) { for (k = 0; k < step; ++k) {

Loading…
Cancel
Save