mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-11-21 10:55:51 +02:00
Merge commit '4d0ee4962be7e07cdc038a78008ef2e4e47e5f81'
* commit '4d0ee4962be7e07cdc038a78008ef2e4e47e5f81': avi: Validate sample_size Conflicts: libavformat/avidec.c See:ca234639ac
See:c7369f3a4b
Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
73b8155b31
@ -693,9 +693,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) {
|
||||
|
Loading…
Reference in New Issue
Block a user