pngdec: check for bprint finalization sucess on icc data parsing

It can fail in case of OOM.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
This commit is contained in:
Rostislav Pehlivanov 2017-11-09 02:34:54 +00:00
parent 3228ac730c
commit 723b6baaf8
1 changed files with 2 additions and 0 deletions

View File

@ -862,6 +862,8 @@ static int decode_iccp_chunk(PNGDecContext *s, int length, AVFrame *f)
return ret;
av_bprint_finalize(&bp, (char **)&data);
if (!data)
return AVERROR(ENOMEM);
sd = av_frame_new_side_data(f, AV_FRAME_DATA_ICC_PROFILE, bp.len);
if (!sd) {