summaryrefslogtreecommitdiff
path: root/src/bin/jp2/convertbmp.c
diff options
context:
space:
mode:
authorMatthieu Darbois <mayeut@users.noreply.github.com>2016-04-30 00:33:27 +0200
committerMatthieu Darbois <mayeut@users.noreply.github.com>2016-04-30 00:33:27 +0200
commit15f081c89650dccee4aa4ae66f614c3fdb268767 (patch)
tree3c3f4395b1c871b20681a2a31895571f6d2df78e /src/bin/jp2/convertbmp.c
parentad593c9e0622e0d8d87228e67e4dbd36243ffd22 (diff)
Fix Out-Of-Bounds Read in sycc42x_to_rgb function (#745)
42x Images with an odd x0/y0 lead to subsampled component starting at the 2nd column/line. That is offset = comp->dx * comp->x0 - image->x0 = 1 Fix #726
Diffstat (limited to 'src/bin/jp2/convertbmp.c')
-rw-r--r--src/bin/jp2/convertbmp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/bin/jp2/convertbmp.c b/src/bin/jp2/convertbmp.c
index a09c0ae5..d264823f 100644
--- a/src/bin/jp2/convertbmp.c
+++ b/src/bin/jp2/convertbmp.c
@@ -967,7 +967,7 @@ int imagetobmp(opj_image_t * image, const char *outfile) {
fprintf(fdest, "%c", (OPJ_UINT8)r);
if ((i + 1) % w == 0) {
- for ((pad = w % 4) ? (4 - w % 4) : 0; pad > 0; pad--) /* ADD */
+ for (pad = (w % 4) ? (4 - w % 4) : 0; pad > 0; pad--) /* ADD */
fprintf(fdest, "%c", 0);
}
}