libopenjpegenc: add NULL check for img before accessing it
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Sun, 31 May 2015 22:51:30 +0000 (00:51 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Mon, 20 Jul 2015 02:43:39 +0000 (04:43 +0200)
commitd6d328c2947c2864267bf913873c7db963e42327
treeb5e95af2cf5a2c45888371bd1e1b7113ce5c80f4
parent9591f2fe94fc1e218b68d777abaffc3f3670f0a0
libopenjpegenc: add NULL check for img before accessing it

If opj_image_create fails to allocate an image it returns NULL, which
causes a segmentation fault at 'img->x0 = 0'.

Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 1577526b47439f33a999339efdec5d624b70e1da)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/libopenjpegenc.c