avformat/avidec: print a warning for negative sample_size

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2015-05-04 23:42:24 +02:00
parent ca234639ac
commit c7369f3a4b

View File

@ -693,6 +693,8 @@ 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) {
st->duration = st->nb_frames;