diff options
author | Rostislav Pehlivanov <atomnuker@gmail.com> | 2017-11-09 02:34:54 +0000 |
---|---|---|
committer | Rostislav Pehlivanov <atomnuker@gmail.com> | 2017-11-09 02:34:54 +0000 |
commit | 723b6baaf8db43d0872bad504c4f4c780b53516b (patch) | |
tree | d72a407f85d575a9ebc1acda6cf9679defa1a694 /libavcodec/pngdec.c | |
parent | 3228ac730c11eca49d5680d5550128e397061c85 (diff) | |
download | ffmpeg-723b6baaf8db43d0872bad504c4f4c780b53516b.tar.gz |
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>
Diffstat (limited to 'libavcodec/pngdec.c')
-rw-r--r-- | libavcodec/pngdec.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index 0d6612ccca..5a3d288374 100644 --- a/libavcodec/pngdec.c +++ b/libavcodec/pngdec.c @@ -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) { |