vorbisdec: avoid invalid memory access

This fixes some invalid memory access caused later in the function
by res_chan[] not being set for all channels. This happens when a
channel doesn't appear a submap. This change simply returns a
decoder error when this situation is detected.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
This commit is contained in:
Aaron Colwell 2012-03-07 14:51:00 -08:00 committed by Ronald S. Bultje
parent ef0d779706
commit 12623a8026
1 changed files with 3 additions and 0 deletions

View File

@ -1581,6 +1581,9 @@ static int vorbis_parse_audio_packet(vorbis_context *vc)
ch_left -= ch;
}
if (ch_left > 0)
return AVERROR_INVALIDDATA;
// Inverse coupling
for (i = mapping->coupling_steps - 1; i >= 0; --i) { //warning: i has to be signed