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.
This commit is contained in:
wm4 2018-03-01 13:39:45 +01:00 committed by Jan Ekström
parent 6f27a165a8
commit e0c67977b2
1 changed files with 2 additions and 2 deletions

View File

@ -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) {