From 766623a042acef2ddc5e295aff8f2f426158007e Mon Sep 17 00:00:00 2001 From: naddy Date: Thu, 24 Sep 2009 20:07:18 +0000 Subject: [PATCH] Fix out-of-bounds access in CMYK to RGB conversion. From: Patrick Keshishian --- graphics/xv/Makefile | 4 ++-- graphics/xv/patches/patch-xvjpeg_c | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 graphics/xv/patches/patch-xvjpeg_c diff --git a/graphics/xv/Makefile b/graphics/xv/Makefile index 58fdc33bcf3..9794892bbbf 100644 --- a/graphics/xv/Makefile +++ b/graphics/xv/Makefile @@ -1,9 +1,9 @@ -# $OpenBSD: Makefile,v 1.37 2009/08/10 06:31:45 kili Exp $ +# $OpenBSD: Makefile,v 1.38 2009/09/24 20:07:18 naddy Exp $ COMMENT= X11 image display and modification tool DISTNAME= xv-3.10a -PKGNAME= ${DISTNAME}p7 +PKGNAME= ${DISTNAME}p8 CATEGORIES= graphics x11 MASTER_SITES= ftp://ftp.mirrorservice.org/sites/ftp.cis.upenn.edu/pub/xv/ \ diff --git a/graphics/xv/patches/patch-xvjpeg_c b/graphics/xv/patches/patch-xvjpeg_c new file mode 100644 index 00000000000..846c1168ca9 --- /dev/null +++ b/graphics/xv/patches/patch-xvjpeg_c @@ -0,0 +1,21 @@ +$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 */ + }