Skip to content
Permalink
Browse files

Fix Heap Buffer Overflow in function color_cmyk_to_rgb

Fix #774
  • Loading branch information...
mayeut committed May 8, 2016
1 parent 8f9cc62 commit 162f6199c0cd3ec1c6c6dc65e41b2faab92b2d91
Showing with 10 additions and 1 deletion.
  1. +8 −1 src/bin/common/color.c
  2. +2 −0 tests/nonregression/test_suite.ctest.in
@@ -855,7 +855,14 @@ void color_cmyk_to_rgb(opj_image_t *image)
w = image->comps[0].w;
h = image->comps[0].h;

if(image->numcomps < 4) return;
if (
(image->numcomps < 4)
|| (image->comps[0].dx != image->comps[1].dx) || (image->comps[0].dx != image->comps[2].dx) || (image->comps[0].dx != image->comps[3].dx)
|| (image->comps[0].dy != image->comps[1].dy) || (image->comps[0].dy != image->comps[2].dy) || (image->comps[0].dy != image->comps[3].dy)
) {
fprintf(stderr,"%s:%d:color_cmyk_to_rgb\n\tCAN NOT CONVERT\n", __FILE__,__LINE__);
return;
}

max = w * h;

@@ -559,3 +559,5 @@ opj_decompress -i @INPUT_NR_PATH@/basn6a08.jp2 -o @TEMP_PATH@/basn6a08_tif-15.ti
opj_decompress -i @INPUT_NR_PATH@/issue726.j2k -o @TEMP_PATH@/issue726.png
# issue 733
!opj_decompress -i @INPUT_NR_PATH@/issue733.jp2 -o @TEMP_PATH@/issue733.png
# issue 774
!opj_decompress -i @INPUT_NR_PATH@/issue774.jp2 -o @TEMP_PATH@/issue774.png

0 comments on commit 162f619

Please sign in to comment.
You can’t perform that action at this time.