Browse Source

Merge commit 'a55a70644872027fdf76a75edf12a09c9008880f' into release/2.4

* commit 'a55a70644872027fdf76a75edf12a09c9008880f':
  avi: Validate sample_size

Conflicts:
	libavformat/avidec.c

See: ca234639ac
See: c7369f3a4b
Merged-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.4.10
Michael Niedermayer 10 years ago
parent
commit
9005075f39
1 changed files with 17 additions and 3 deletions
  1. +17
    -3
      libavformat/avidec.c

+ 17
- 3
libavformat/avidec.c View File

@@ -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) {


Loading…
Cancel
Save