diff options
| author | mayeut <mayeut@users.noreply.github.com> | 2016-05-08 19:18:05 +0200 |
|---|---|---|
| committer | mayeut <mayeut@users.noreply.github.com> | 2016-05-08 19:18:05 +0200 |
| commit | 162f6199c0cd3ec1c6c6dc65e41b2faab92b2d91 (patch) | |
| tree | f0305a60841868149e46aef917b86b8d17d9c9b9 /src | |
| parent | 8f9cc62b3f9a1da9712329ddcedb9750d585505c (diff) | |
Fix Heap Buffer Overflow in function color_cmyk_to_rgb
Fix uclouvain/openjpeg#774
Diffstat (limited to 'src')
| -rw-r--r-- | src/bin/common/color.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/bin/common/color.c b/src/bin/common/color.c index 944df73b..234c7bdf 100644 --- a/src/bin/common/color.c +++ b/src/bin/common/color.c @@ -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; |
