Commit 5e9a56a0 authored by Michael Niedermayer's avatar Michael Niedermayer

shorten: validate values in fmt chunk search

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 18bcfc91
......@@ -205,7 +205,7 @@ static int decode_wave_header(AVCodecContext *avctx, const uint8_t *header,
{
int len;
short wave_format;
const uint8_t *end= header + header_size;
if (bytestream_get_le32(&header) != MKTAG('R','I','F','F')) {
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',' ')) {
len = bytestream_get_le32(&header);
if(len<0 || end - header - 8 < len)
return AVERROR_INVALIDDATA;
header += len;
}
len = bytestream_get_le32(&header);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment