提交 133dafe2 编写于 作者: R Rostislav Pehlivanov

pngdec: fix potential memory leak

Fixes CID1412026.
Signed-off-by: NRostislav Pehlivanov <atomnuker@gmail.com>
上级 5d0b69f3
......@@ -863,8 +863,11 @@ static int decode_iccp_chunk(PNGDecContext *s, int length, AVFrame *f)
av_bprint_finalize(&bp, (char **)&data);
if (!(sd = av_frame_new_side_data(f, AV_FRAME_DATA_ICC_PROFILE, bp.len)))
sd = av_frame_new_side_data(f, AV_FRAME_DATA_ICC_PROFILE, bp.len);
if (!sd) {
av_free(data);
return AVERROR(ENOMEM);
}
av_dict_set(&sd->metadata, "name", profile_name, 0);
memcpy(sd->data, data, bp.len);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册