diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-05-19 21:24:39 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-05-19 21:24:51 +0200 |
commit | 9005075f397bc7bd2fa2e193f62cbf971bdaa4d4 (patch) | |
tree | e9d93f30e7effe182c305a136d5abe959bc3ad92 | |
parent | 9f4979b24c9a455b1ef16ee97dfeb21e4cfde1ba (diff) | |
parent | a55a70644872027fdf76a75edf12a09c9008880f (diff) | |
download | ffmpeg-9005075f397bc7bd2fa2e193f62cbf971bdaa4d4.tar.gz |
Merge commit 'a55a70644872027fdf76a75edf12a09c9008880f' into release/2.4
* commit 'a55a70644872027fdf76a75edf12a09c9008880f':
avi: Validate sample_size
Conflicts:
libavformat/avidec.c
See: ca234639ac49a0dc073ac1f10977979acdb94f97
See: c7369f3a4bd21ea64571c1b0c4fcbf39f8daf68c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/avidec.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/libavformat/avidec.c b/libavformat/avidec.c index 8c638de7b5..eec748f9d0 100644 --- a/libavformat/avidec.c +++ b/libavformat/avidec.c @@ -685,9 +685,23 @@ static int avi_read_header(AVFormatContext *s) default: av_log(s, AV_LOG_INFO, "unknown stream type %X\n", tag1); } - if (ast->sample_size < 0) - av_log(s, AV_LOG_WARNING, "sample size %d is invalid\n", ast->sample_size); - ast->sample_size = FFMAX(ast->sample_size, 0); + + if (ast->sample_size < 0) { + if (s->error_recognition & AV_EF_EXPLODE) { + av_log(s, AV_LOG_ERROR, + "Invalid sample_size %d at stream %d\n", + ast->sample_size, + stream_index); + goto fail; + } + av_log(s, AV_LOG_WARNING, + "Invalid sample_size %d at stream %d " + "setting it to 0\n", + ast->sample_size, + stream_index); + ast->sample_size = 0; + } + if (ast->sample_size == 0) { st->duration = st->nb_frames; if (st->duration > 0 && avi->io_fsize > 0 && avi->riff_end > avi->io_fsize) { |