Skip to content

Commit

Permalink
Fixes 1st image crash of uclouvain#704
Browse files Browse the repository at this point in the history
Prevents color_esycc_to_rgb to be applied when different subsampling
are used.
  • Loading branch information
mayeut committed Apr 23, 2016
1 parent a9feb9a commit af4a9d9
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/bin/common/color.c
Original file line number Diff line number Diff line change
Expand Up @@ -745,6 +745,19 @@ void color_esycc_to_rgb(opj_image_t *image)
int max_value = (1 << image->comps[0].prec) - 1;

if(image->numcomps < 3) return;
if((image->comps[0].dx == image->comps[1].dx)
&& (image->comps[1].dx == image->comps[2].dx)
&& (image->comps[0].dy == image->comps[1].dy)
&& (image->comps[1].dy == image->comps[2].dy))/* same sub-sampling */
{
// go on
}
else
{
fprintf(stderr,"%s:%d:color_esycc_to_rgb\n\tCAN NOT CONVERT\n", __FILE__,__LINE__);
return;
}


w = image->comps[0].w;
h = image->comps[0].h;
Expand Down

0 comments on commit af4a9d9

Please sign in to comment.