Skip to content
Permalink
Browse files Browse the repository at this point in the history
...
  • Loading branch information
Cristy committed May 21, 2017
1 parent 4107887 commit acee073
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion coders/jp2.c
Expand Up @@ -388,7 +388,11 @@ static Image *ReadJP2Image(const ImageInfo *image_info,ExceptionInfo *exception)
opj_stream_destroy(jp2_stream);
for (i=0; i < (ssize_t) jp2_image->numcomps; i++)
{
if ((jp2_image->comps[i].dx == 0) || (jp2_image->comps[i].dy == 0))
if ((jp2_image->comps[0].dx == 0) || (jp2_image->comps[0].dy == 0) ||
(jp2_image->comps[0].dx != jp2_image->comps[i].dx) ||
(jp2_image->comps[0].dy != jp2_image->comps[i].dy) ||
(jp2_image->comps[0].prec != jp2_image->comps[i].prec) ||
(jp2_image->comps[0].sgnd != jp2_image->comps[i].sgnd))
{
opj_destroy_codec(jp2_codec);
opj_image_destroy(jp2_image);
Expand Down

0 comments on commit acee073

Please sign in to comment.