riff: retry reading metadata without padding if it fails with
Fixes Ticket1821
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d0c27e88d2
)
This commit is contained in:

committed by
Carl Eugen Hoyos

parent
213f651498
commit
1a5b7ce0ea
@@ -704,12 +704,17 @@ int ff_read_riff_info(AVFormatContext *s, int64_t size)
|
|||||||
char key[5] = {0};
|
char key[5] = {0};
|
||||||
char *value;
|
char *value;
|
||||||
|
|
||||||
|
chunk_code = avio_rl32(pb);
|
||||||
|
chunk_size = avio_rl32(pb);
|
||||||
|
if (chunk_size > end || end - chunk_size < cur || chunk_size == UINT_MAX) {
|
||||||
|
avio_seek(pb, -9, SEEK_CUR);
|
||||||
chunk_code = avio_rl32(pb);
|
chunk_code = avio_rl32(pb);
|
||||||
chunk_size = avio_rl32(pb);
|
chunk_size = avio_rl32(pb);
|
||||||
if (chunk_size > end || end - chunk_size < cur || chunk_size == UINT_MAX) {
|
if (chunk_size > end || end - chunk_size < cur || chunk_size == UINT_MAX) {
|
||||||
av_log(s, AV_LOG_ERROR, "too big INFO subchunk\n");
|
av_log(s, AV_LOG_ERROR, "too big INFO subchunk\n");
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
chunk_size += (chunk_size & 1);
|
chunk_size += (chunk_size & 1);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user