Commit 73b8155b authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '4d0ee496'

* commit '4d0ee496':
  avi: Validate sample_size

Conflicts:
	libavformat/avidec.c

See: ca234639
See: c7369f3aMerged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 8b0ceb96 4d0ee496
......@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment