]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/indeo5.c
lavc/vda: fix make checkheaders.
[ffmpeg] / libavcodec / indeo5.c
index b35486b106224769354bb2552ff981b8a12179a0..1945f06a3f5e2127489b70a1468b54a03c66c89e 100644 (file)
@@ -78,6 +78,7 @@ typedef struct {
     IVIPicConfig    pic_conf;
 
     int gop_invalid;
+    int buf_invalid[3];
 } IVI5DecContext;
 
 
@@ -355,6 +356,12 @@ static int decode_pic_hdr(IVI5DecContext *ctx, AVCodecContext *avctx)
         ctx->gop_invalid = 0;
     }
 
+    if (ctx->frame_type == FRAMETYPE_INTER_SCAL && !ctx->is_scalable) {
+        av_log(avctx, AV_LOG_ERROR, "Scalable inter frame in non scaleable stream\n");
+        ctx->frame_type = FRAMETYPE_INTER;
+        return AVERROR_INVALIDDATA;
+    }
+
     if (ctx->frame_type != FRAMETYPE_NULL) {
         ctx->frame_flags = get_bits(&ctx->gb, 8);
 
@@ -797,6 +804,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
     //{ START_TIMER;
 
     if (ctx->frame_type != FRAMETYPE_NULL) {
+        ctx->buf_invalid[ctx->dst_buf] = 1;
         for (p = 0; p < 3; p++) {
             for (b = 0; b < ctx->planes[p].num_bands; b++) {
                 result = decode_band(ctx, p, &ctx->planes[p].bands[b], avctx);
@@ -807,7 +815,10 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
                 }
             }
         }
+        ctx->buf_invalid[ctx->dst_buf] = 0;
     }
+    if (ctx->buf_invalid[ctx->dst_buf])
+        return -1;
 
     //STOP_TIMER("decode_planes"); }