Skip to content
Snippets Groups Projects
Commit 5e9a56a0 authored by Michael Niedermayer's avatar Michael Niedermayer
Browse files

shorten: validate values in fmt chunk search

parent 18bcfc91
No related branches found
No related tags found
No related merge requests found
...@@ -205,7 +205,7 @@ static int decode_wave_header(AVCodecContext *avctx, const uint8_t *header, ...@@ -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, ...@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment