avformat/avidec: print a warning for negative sample_size
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 4 May 2015 21:42:24 +0000 (23:42 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 4 May 2015 22:04:38 +0000 (00:04 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/avidec.c

index 0668b17..ab9d53e 100644 (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;