opj_decompress: add sanity checks to avoid segfault in case of decoding error 1240/head
authorEven Rouault <even.rouault@spatialys.com>
Wed, 1 Apr 2020 18:58:55 +0000 (20:58 +0200)
committerEven Rouault <even.rouault@spatialys.com>
Wed, 1 Apr 2020 19:11:36 +0000 (21:11 +0200)
commit1c54024165fd5db0e6047f28903274eb27d0980f
tree86ce2c02bf2cc2f11cab5bd7130a66d4ce34381c
parent563ecfb55ca77c0fc5ea19e4885e00f55ec82ca9
opj_decompress: add sanity checks to avoid segfault in case of decoding error

Prevent crashes like:
opj_decompress -i 0722_5-1_2019.jp2 -o out.ppm -r 4 -t 0

where 0722_5-1_2019.jp2 is
https://drive.google.com/file/d/1ZxOUZg2-FKjYwa257VFLMpTXRWxEoP0a/view?usp=sharing
src/bin/jp2/convert.c
src/bin/jp2/convertpng.c
src/bin/jp2/converttif.c