Browse Source

avformat/redspark: check coef_off

Fixes out of array reads

Found-by: Laurent Butti <laurentb@gmail.com>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.1
Michael Niedermayer 12 years ago
parent
commit
aadfadd784
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      libavformat/redspark.c

+ 5
- 0
libavformat/redspark.c View File

@@ -108,6 +108,11 @@ static int redspark_read_header(AVFormatContext *s)
if (bytestream2_get_byteu(&gbc)) // Loop flag
coef_off += 16;

if (coef_off + codec->channels * (32 + 14) > HEADER_SIZE) {
ret = AVERROR_INVALIDDATA;
goto fail;
}

codec->extradata_size = 32 * codec->channels;
codec->extradata = av_malloc(codec->extradata_size);
if (!codec->extradata) {


Loading…
Cancel
Save