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)
committerAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Tue, 2 Jun 2015 20:40:58 +0000 (22:40 +0200)
commit1577526b47439f33a999339efdec5d624b70e1da
tree4fbf87887c4467e457e22571006d25d7a8e79199
parentb0af4043b90802ecf888a9bf0075c4d55cfb2d38
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>
libavcodec/libopenjpegenc.c