diff options
author | Anton Khirnov <anton@khirnov.net> | 2024-09-20 11:16:17 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2024-09-23 17:11:40 +0200 |
commit | bcbe999077a3b433ec10323ab9c05b9c7876866c (patch) | |
tree | 2f74d54e344211125a3a208c8685433241d3a0e9 /libavcodec/decode.c | |
parent | e19551d16524b04d01b24962f385a17f87566c8e (diff) | |
download | ffmpeg-bcbe999077a3b433ec10323ab9c05b9c7876866c.tar.gz |
lavc/decode: clear side data in reget_buffer()
Otherwise it may accumulate when e.g. global side data is repeatedly
copied to the frame with in each subsequent reget_buffer() call.
Diffstat (limited to 'libavcodec/decode.c')
-rw-r--r-- | libavcodec/decode.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/decode.c b/libavcodec/decode.c index 844f1d02e4..a151f41442 100644 --- a/libavcodec/decode.c +++ b/libavcodec/decode.c @@ -1730,6 +1730,8 @@ static int reget_buffer_internal(AVCodecContext *avctx, AVFrame *frame, int flag if (!frame->data[0]) return ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF); + av_frame_side_data_free(&frame->side_data, &frame->nb_side_data); + if ((flags & FF_REGET_BUFFER_FLAG_READONLY) || av_frame_is_writable(frame)) return ff_decode_frame_props(avctx, frame); |