Signed-off-by: Paul B Mahol <[email protected]>
---
libavcodec/smc.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/libavcodec/smc.c b/libavcodec/smc.c
index 9cd86216a2..2f43984b99 100644
--- a/libavcodec/smc.c
+++ b/libavcodec/smc.c
@@ -459,6 +459,17 @@ static int smc_decode_frame(AVCodecContext *avctx,
return buf_size;
}
+static void smc_decode_flush(AVCodecContext *avctx)
+{
+ SmcContext *s = avctx->priv_data;
+
+ memset(s->color_pairs, 0, sizeof(s->color_pairs));
+ memset(s->color_quads, 0, sizeof(s->color_quads));
+ memset(s->color_octets, 0, sizeof(s->color_octets));
+
+ av_frame_unref(s->frame);
+}
+
static av_cold int smc_decode_end(AVCodecContext *avctx)
{
SmcContext *s = avctx->priv_data;
@@ -477,6 +488,7 @@ const AVCodec ff_smc_decoder = {
.init = smc_decode_init,
.close = smc_decode_end,
.decode = smc_decode_frame,
+ .flush = smc_decode_flush,
.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};
--
2.17.1
_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".