opj_decompress: fix null pointer dereference on comps[].data on id_000167,sig_11,src_006079,op_havoc,rep_4 (#939)

This commit is contained in:
Even Rouault 2017-07-26 20:13:09 +02:00
parent 8d2e69e37d
commit 94cc97c58a
1 changed files with 11 additions and 0 deletions

View File

@ -1489,6 +1489,17 @@ int main(int argc, char **argv)
} }
} }
/* FIXME? Shouldn't that situation be considered as an error of */
/* opj_decode() / opj_get_decoded_tile() ? */
if (image->comps[0].data == NULL) {
fprintf(stderr, "ERROR -> opj_decompress: no image data!\n");
opj_destroy_codec(l_codec);
opj_stream_destroy(l_stream);
opj_image_destroy(image);
failed = 1;
goto fin;
}
tCumulative += opj_clock() - t; tCumulative += opj_clock() - t;
numDecompressedImages++; numDecompressedImages++;