libopenjpegenc: add NULL check for img before accessing it n2.4.10
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Sun, 31 May 2015 22:51:30 +0000 (00:51 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 3 Jun 2015 01:22:17 +0000 (03:22 +0200)
commit1047c286fa20c79dde8ddd7577a3b87cc1effdb7
treed5afc76702e06be8f5222c151e121dc258e972a5
parentbf6ba4a0328167802236e5e4727342a0c2f225f2
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