diff --git a/libavcodec/ivi.c b/libavcodec/ivi.c index 7d3749b818..c5c50fb5c1 100644 --- a/libavcodec/ivi.c +++ b/libavcodec/ivi.c @@ -1192,6 +1192,8 @@ int ff_ivi_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket pkt; pkt.data = avpkt->data + (get_bits_count(&ctx->gb) >> 3); pkt.size = get_bits_left(&ctx->gb) >> 3; + ctx->got_p_frame = 0; + av_frame_unref(ctx->p_frame); ff_ivi_decode_frame(avctx, ctx->p_frame, &ctx->got_p_frame, &pkt); } }