From e0c67977b2d8cb7e90c2cb6522594a9bdd566ccf Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 1 Mar 2018 13:39:45 +0100 Subject: mp_image: fix subtle side data memory leaks We must not create new references herem because mp_image_new_ref() is called later, and actually creates new references (including doing actual error checking). Blame C, not me. --- video/mp_image.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/video/mp_image.c b/video/mp_image.c index f6b6045c6d..80c1ee266a 100644 --- a/video/mp_image.c +++ b/video/mp_image.c @@ -877,7 +877,7 @@ struct mp_image *mp_image_from_av_frame(struct AVFrame *src) #if LIBAVUTIL_VERSION_MICRO >= 100 sd = av_frame_get_side_data(src, AV_FRAME_DATA_ICC_PROFILE); if (sd) - dst->icc_profile = av_buffer_ref(sd->buf); + dst->icc_profile = sd->buf; // Get the content light metadata if available sd = av_frame_get_side_data(src, AV_FRAME_DATA_CONTENT_LIGHT_LEVEL); @@ -896,7 +896,7 @@ struct mp_image *mp_image_from_av_frame(struct AVFrame *src) sd = av_frame_get_side_data(src, AV_FRAME_DATA_A53_CC); if (sd) - dst->a53_cc = av_buffer_ref(sd->buf); + dst->a53_cc = sd->buf; #endif if (dst->hwctx) { -- cgit v1.2.3