vorbisdec: use correct channels variable.
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>
Wed, 11 Apr 2012 19:04:46 +0000 (21:04 +0200)
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>
Thu, 12 Apr 2012 18:32:08 +0000 (20:32 +0200)
All code should use the local variable, the
AVCodecContext might not yet have the updated value.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
libavcodec/vorbisdec.c

index 2bdb118..ddc79fc 100644 (file)
@@ -687,7 +687,7 @@ static int vorbis_parse_setup_hdr_residues(vorbis_context *vc)
         res_setup->partition_size = get_bits(gb, 24) + 1;
         /* Validations to prevent a buffer overflow later. */
         if (res_setup->begin>res_setup->end ||
-            res_setup->end > (res_setup->type == 2 ? vc->avccontext->channels : 1) * vc->blocksize[1] / 2 ||
+            res_setup->end > (res_setup->type == 2 ? vc->audio_channels : 1) * vc->blocksize[1] / 2 ||
             (res_setup->end-res_setup->begin) / res_setup->partition_size > V_MAX_PARTITIONS) {
             av_log(vc->avccontext, AV_LOG_ERROR,
                    "partition out of bounds: type, begin, end, size, blocksize: %"PRIu16", %"PRIu32", %"PRIu32", %u, %"PRIu32"\n",