From: Niklas Haas <[email protected]> Also fixes a memory leak where the side data was previously not properly cleaned up on OOM, although we now unfortunately don't distinguish between OOM and overriden side data.
Signed-off-by: Anton Khirnov <[email protected]> --- libavcodec/libjxldec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/libjxldec.c b/libavcodec/libjxldec.c index b830eee784..e1dda99b73 100644 --- a/libavcodec/libjxldec.c +++ b/libavcodec/libjxldec.c @@ -483,9 +483,9 @@ static int libjxl_receive_frame(AVCodecContext *avctx, AVFrame *frame) /* full image is one frame, even if animated */ av_log(avctx, AV_LOG_DEBUG, "FULL_IMAGE event emitted\n"); if (ctx->iccp) { - AVFrameSideData *sd = av_frame_new_side_data_from_buf(ctx->frame, AV_FRAME_DATA_ICC_PROFILE, ctx->iccp); + AVFrameSideData *sd = ff_frame_new_side_data_from_buf(avctx, ctx->frame, AV_FRAME_DATA_ICC_PROFILE, ctx->iccp); if (!sd) - return AVERROR(ENOMEM); + av_buffer_unref(&ctx->iccp); /* ownership is transfered, and it is not ref-ed */ ctx->iccp = NULL; } -- 2.42.0 _______________________________________________ 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".
