changeset 11973:7ca225db75e8 libavcodec

vorbisdec: Take channels into account when checking against residue overflow Fixes issue1969
author conrad
date Sun, 27 Jun 2010 01:46:23 +0000
parents e36d1bb6d8b7
children 356b20a6566d
files vorbis_dec.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/vorbis_dec.c	Sun Jun 27 01:46:20 2010 +0000
+++ b/vorbis_dec.c	Sun Jun 27 01:46:23 2010 +0000
@@ -645,7 +645,7 @@
         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>vc->blocksize[1] / (res_setup->type == 2 ? 1 : 2) ||
+            res_setup->end > vc->avccontext->channels * vc->blocksize[1] / (res_setup->type == 2 ? 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: %"PRIdFAST16", %"PRIdFAST32", %"PRIdFAST32", %"PRIdFAST32", %"PRIdFAST32"\n", res_setup->type, res_setup->begin, res_setup->end, res_setup->partition_size, vc->blocksize[1] / 2);
             return -1;