Browse Source

shorten: validate values in fmt chunk search

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n0.10
Michael Niedermayer 14 years ago
parent
commit
5e9a56a035
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      libavcodec/shorten.c

+ 3
- 1
libavcodec/shorten.c View File

@@ -205,7 +205,7 @@ static int decode_wave_header(AVCodecContext *avctx, const uint8_t *header,
{ {
int len; int len;
short wave_format; short wave_format;
const uint8_t *end= header + header_size;


if (bytestream_get_le32(&header) != MKTAG('R','I','F','F')) { if (bytestream_get_le32(&header) != MKTAG('R','I','F','F')) {
av_log(avctx, AV_LOG_ERROR, "missing RIFF tag\n"); av_log(avctx, AV_LOG_ERROR, "missing RIFF tag\n");
@@ -221,6 +221,8 @@ static int decode_wave_header(AVCodecContext *avctx, const uint8_t *header,


while (bytestream_get_le32(&header) != MKTAG('f','m','t',' ')) { while (bytestream_get_le32(&header) != MKTAG('f','m','t',' ')) {
len = bytestream_get_le32(&header); len = bytestream_get_le32(&header);
if(len<0 || end - header - 8 < len)
return AVERROR_INVALIDDATA;
header += len; header += len;
} }
len = bytestream_get_le32(&header); len = bytestream_get_le32(&header);


Loading…
Cancel
Save