]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/indeo3.c
ff_emulated_edge_mc: fix handling of w/h being 0
[ffmpeg] / libavcodec / indeo3.c
index 126bd2bf530d404616999eadf451f1ff24677d4b..013d6107cf635401dad6160835c645c738f2ddfb 100644 (file)
@@ -1084,6 +1084,15 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
     /* use BS_BUFFER flag for buffer switching */
     ctx->buf_sel = (ctx->frame_flags >> BS_BUFFER) & 1;
 
+    if (ctx->frame.data[0])
+        avctx->release_buffer(avctx, &ctx->frame);
+
+    ctx->frame.reference = 0;
+    if ((res = avctx->get_buffer(avctx, &ctx->frame)) < 0) {
+        av_log(ctx->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+        return res;
+    }
+
     /* decode luma plane */
     if ((res = decode_plane(ctx, avctx, ctx->planes, ctx->y_data_ptr, ctx->y_data_size, 40)))
         return res;
@@ -1095,15 +1104,6 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
     if ((res = decode_plane(ctx, avctx, &ctx->planes[2], ctx->v_data_ptr, ctx->v_data_size, 10)))
         return res;
 
-    if (ctx->frame.data[0])
-        avctx->release_buffer(avctx, &ctx->frame);
-
-    ctx->frame.reference = 0;
-    if ((res = avctx->get_buffer(avctx, &ctx->frame)) < 0) {
-        av_log(ctx->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
-        return res;
-    }
-
     output_plane(&ctx->planes[0], ctx->buf_sel,
                  ctx->frame.data[0], ctx->frame.linesize[0],
                  avctx->height);
@@ -1142,4 +1142,5 @@ AVCodec ff_indeo3_decoder = {
     .close          = decode_close,
     .decode         = decode_frame,
     .long_name      = NULL_IF_CONFIG_SMALL("Intel Indeo 3"),
+    .capabilities   = CODEC_CAP_DR1,
 };