Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Conrad <lessen42@gmail.com>2010-06-27 05:46:23 +0400
committerDavid Conrad <lessen42@gmail.com>2010-06-27 05:46:23 +0400
commita02bb835ace0d7bcfd187a0538d7064104bec6a9 (patch)
tree7b46b2cd73135591af0e2f3458fd7812f80afa35 /libavcodec/vorbis_dec.c
parent54fdf5d15092825eea20fa7cbac9f164f683c057 (diff)
vorbisdec: Take channels into account when checking against residue overflow
Fixes issue1969 Originally committed as revision 23812 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/vorbis_dec.c')
-rw-r--r--libavcodec/vorbis_dec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/vorbis_dec.c b/libavcodec/vorbis_dec.c
index 608277a44d..b0f461cdae 100644
--- a/libavcodec/vorbis_dec.c
+++ b/libavcodec/vorbis_dec.c
@@ -645,7 +645,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>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;