openbsd-ports/graphics/xv/patches/patch-xvjpeg_c
naddy 766623a042 Fix out-of-bounds access in CMYK to RGB conversion.
From: Patrick Keshishian <pkeshish@gmail.com>
2009-09-24 20:07:18 +00:00

22 lines
852 B
Plaintext

$OpenBSD: patch-xvjpeg_c,v 1.1 2009/09/24 20:07:18 naddy Exp $
--- xvjpeg.c.orig Thu Sep 24 21:58:28 2009
+++ xvjpeg.c Thu Sep 24 21:58:45 2009
@@ -696,7 +696,7 @@ L2:
if ((cmy = *q++ - k) < 0) cmy = 0; *p++ = cmy; /* R */
if ((cmy = *q++ - k) < 0) cmy = 0; *p++ = cmy; /* G */
if ((cmy = *q++ - k) < 0) cmy = 0; *p++ = cmy; /* B */
- } while (++q <= pic_end);
+ } while (++q < pic_end);
}
else { /* assume normal data */
register byte *q = pic;
@@ -707,7 +707,7 @@ L2:
if ((cmy = k - *q++) < 0) cmy = 0; *p++ = cmy; /* R */
if ((cmy = k - *q++) < 0) cmy = 0; *p++ = cmy; /* G */
if ((cmy = k - *q++) < 0) cmy = 0; *p++ = cmy; /* B */
- } while (++q <= pic_end);
+ } while (++q < pic_end);
}
pic = realloc(pic,p-pic); /* Release extra storage */
}