commit 8ed060d374d1a4388c34a5be958fe1da83be33da
Author: Paul Howarth <paul(a)city-fan.org>
Date: Mon Feb 28 14:37:15 2022 +0000
Added the following patch from OpenSUSE: xv-3.10a-jpeg8.dif
In libjpeg the numbers of out_color_components and color_components are
different for quantize_colors, i.e. color_components is the colormap
(normally 1) [Novell BZ #412491].
xv-3.10a-jpeg8.patch | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 61 insertions(+)
---
diff --git a/xv-3.10a-jpeg8.patch b/xv-3.10a-jpeg8.patch
new file mode 100644
index 0000000..9599386
--- /dev/null
+++ b/xv-3.10a-jpeg8.patch
@@ -0,0 +1,61 @@
+From b4ada5122c93789800e9ae7ff4dc671db4c4d2c3 Mon Sep 17 00:00:00 2001
+From: Michael Adams <mdadams(a)ece.uvic.ca>
+Date: Sat, 19 Feb 2022 08:09:46 -0800
+Subject: [PATCH 5/6] Added the following patch from OpenSUSE:
+ xv-3.10a-jpeg8.dif
+
+---
+ src/xvjpeg.c | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/src/xvjpeg.c b/src/xvjpeg.c
+index 2594db4..65063e3 100644
+--- a/src/xvjpeg.c
++++ b/src/xvjpeg.c
+@@ -511,7 +511,7 @@ int LoadJFIF(fname, pinfo, quick)
+ JSAMPROW rowptr[1];
+ FILE *fp;
+ const char *colorspace_name = "Color";
+- byte *pic, *pic_end;
++ byte *pic;
+ long filesize;
+ int i,w,h,bperpix,bperline,count;
+
+@@ -625,6 +625,7 @@ L2:
+ * if CONV24_BEST, or other, ask for 24-bit image and hand it to XV
+ */
+ cinfo.desired_number_of_colors = 256;
++ cinfo.colormap = NULL;
+
+ if (conv24 == CONV24_FAST || conv24 == CONV24_SLOW) {
+ cinfo.quantize_colors = TRUE;
+@@ -662,7 +663,6 @@ L2:
+ fbasename);
+ goto L1;
+ }
+- pic_end = pic + count;
+
+ jpeg_start_decompress(&cinfo);
+
+@@ -679,7 +679,8 @@ L2:
+
+ /* Convert CMYK to RGB color space */
+
+- if (bperpix > 3) {
++ if (cinfo.out_color_components > 3) {
++ const byte *pic_end = pic + count;
+ register byte *p = pic;
+
+ /* According to documentation accompanying the IJG JPEG Library, it appears
+@@ -732,7 +733,7 @@ L2:
+ pinfo->colType = F_FULLCOLOR;
+
+ if (cinfo.quantize_colors) {
+- switch (bperpix) {
++ switch (cinfo.out_color_components) {
+ case 3:
+ for (i = 0; i < cinfo.actual_number_of_colors; i++) {
+ pinfo->r[i] = cinfo.colormap[0][i];
+--
+2.35.1
+