diff options
author | wm4 <wm4@nowhere> | 2018-03-01 13:39:45 +0100 |
---|---|---|
committer | Jan Ekström <jeebjp@gmail.com> | 2018-03-03 02:38:01 +0200 |
commit | e0c67977b2d8cb7e90c2cb6522594a9bdd566ccf (patch) | |
tree | 3e7fef703cc927a4a0a063c7375f400e95eeb4a3 /video | |
parent | 6f27a165a8b28e464b732a0b349ea382b0123ba7 (diff) | |
download | mpv-e0c67977b2d8cb7e90c2cb6522594a9bdd566ccf.tar.bz2 mpv-e0c67977b2d8cb7e90c2cb6522594a9bdd566ccf.tar.xz |
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.
Diffstat (limited to 'video')
-rw-r--r-- | video/mp_image.c | 4 |
1 files 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) { |