SHA256
1
0
forked from pool/emacs
Dr. Werner Fink 2014-09-03 10:43:09 +00:00 committed by Git OBS Bridge
parent 587f9989e2
commit bf923c409f
4 changed files with 45 additions and 42 deletions

View File

@ -1,22 +0,0 @@
2014-01-07 Paul Eggert <eggert@cs.ucla.edu>
Fix misdisplay of interlaced GIFs with libgif5 (Bug#16372).
* image.c (gif_load): libgif5 deinterlaces for us, so don't do
it again.
Index: emacs-24.3/src/image.c
===================================================================
--- emacs-24.3/src/image.c
+++ emacs-24.3/src/image.c
@@ -7378,7 +7378,10 @@ gif_load (struct frame *f, struct image
}
/* Apply the pixel values. */
- if (gif->SavedImages[j].ImageDesc.Interlace)
+#ifndef GIFLIB_MAJOR
+# define GIFLIB_MAJOR 0
+#endif
+ if (GIFLIB_MAJOR < 5 && gif->SavedImages[j].ImageDesc.Interlace)
{
int row, pass;

View File

@ -1,24 +1,21 @@
---
src/image.c | 29 +++++++++++++++++++++++------
1 file changed, 23 insertions(+), 6 deletions(-)
emacs-24.3/src/image.c | 36 ++++++++++++++++++++++++++++--------
1 file changed, 28 insertions(+), 8 deletions(-)
Index: emacs-24.3/src/image.c
===================================================================
--- emacs-24.3.orig/src/image.c
+++ emacs-24.3/src/image.c
@@ -7095,11 +7095,20 @@ gif_image_p (Lisp_Object object)
--- emacs-24.3/src/image.c
+++ emacs-24.3/src/image.c 2014-09-03 10:07:32.000000000 +0000
@@ -7095,11 +7095,19 @@ gif_image_p (Lisp_Object object)
#endif /* HAVE_NTGUI */
+#if !defined(GIFLIB_MAJOR) || !(GIFLIB_MAJOR > 5 || \
+ GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1)
+# define GIF7
+#ifndef GIFLIB_MAJOR
+# define GIFLIB_MAJOR 0
+#endif
#ifdef WINDOWSNT
/* GIF library details. */
+#ifdef GIF7
+#if (GIFLIB_MAJOR > 5 || (GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1))
+DEF_IMGLIB_FN (int, DGifCloseFile, (GifFileType *, int *));
+#else
DEF_IMGLIB_FN (int, DGifCloseFile, (GifFileType *));
@ -27,7 +24,20 @@ Index: emacs-24.3/src/image.c
DEF_IMGLIB_FN (int, DGifSlurp, (GifFileType *));
DEF_IMGLIB_FN (GifFileType *, DGifOpen, (void *, InputFunc));
DEF_IMGLIB_FN (GifFileType *, DGifOpenFileName, (const char *));
@@ -7192,7 +7201,11 @@ gif_load (struct frame *f, struct image
@@ -7121,7 +7129,11 @@ init_gif_functions (void)
#else
-#define fn_DGifCloseFile DGifCloseFile
+#if (GIFLIB_MAJOR > 5 || (GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1))
+#define fn_DGifCloseFile(a,b) DGifCloseFile(a,b)
+#else
+#define fn_DGifCloseFile(a,b) DGifCloseFile(a)
+#endif
#define fn_DGifSlurp DGifSlurp
#define fn_DGifOpen DGifOpen
#define fn_DGifOpenFileName DGifOpenFileName
@@ -7192,7 +7204,11 @@ gif_load (struct frame *f, struct image
}
/* Open the GIF file. */
@ -39,7 +49,7 @@ Index: emacs-24.3/src/image.c
if (gif == NULL)
{
image_error ("Cannot open `%s'", file, Qnil);
@@ -7213,7 +7226,11 @@ gif_load (struct frame *f, struct image
@@ -7213,7 +7229,11 @@ gif_load (struct frame *f, struct image
memsrc.len = SBYTES (specified_data);
memsrc.index = 0;
@ -51,7 +61,7 @@ Index: emacs-24.3/src/image.c
if (!gif)
{
image_error ("Cannot open memory source `%s'", img->spec, Qnil);
@@ -7225,7 +7242,7 @@ gif_load (struct frame *f, struct image
@@ -7225,7 +7245,7 @@ gif_load (struct frame *f, struct image
if (!check_image_size (f, gif->SWidth, gif->SHeight))
{
image_error ("Invalid image size (see `max-image-size')", Qnil, Qnil);
@ -60,7 +70,7 @@ Index: emacs-24.3/src/image.c
return 0;
}
@@ -7234,7 +7251,7 @@ gif_load (struct frame *f, struct image
@@ -7234,7 +7254,7 @@ gif_load (struct frame *f, struct image
if (rc == GIF_ERROR || gif->ImageCount <= 0)
{
image_error ("Error reading `%s'", img->spec, Qnil);
@ -69,7 +79,7 @@ Index: emacs-24.3/src/image.c
return 0;
}
@@ -7246,7 +7263,7 @@ gif_load (struct frame *f, struct image
@@ -7246,7 +7266,7 @@ gif_load (struct frame *f, struct image
{
image_error ("Invalid image number `%s' in image `%s'",
image_number, img->spec);
@ -78,7 +88,7 @@ Index: emacs-24.3/src/image.c
return 0;
}
}
@@ -7264,14 +7281,14 @@ gif_load (struct frame *f, struct image
@@ -7264,14 +7284,14 @@ gif_load (struct frame *f, struct image
if (!check_image_size (f, width, height))
{
image_error ("Invalid image size (see `max-image-size')", Qnil, Qnil);
@ -95,7 +105,16 @@ Index: emacs-24.3/src/image.c
return 0;
}
@@ -7447,7 +7464,7 @@ gif_load (struct frame *f, struct image
@@ -7370,7 +7390,7 @@ gif_load (struct frame *f, struct image
}
/* Apply the pixel values. */
- if (gif->SavedImages[j].ImageDesc.Interlace)
+ if (GIFLIB_MAJOR < 5 && gif->SavedImages[j].ImageDesc.Interlace)
{
int row, pass;
@@ -7447,7 +7467,7 @@ gif_load (struct frame *f, struct image
Fcons (make_number (gif->ImageCount),
img->lisp_data));

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Wed Sep 3 10:31:56 UTC 2014 - werner@suse.de
- Make it work again, that is
remove emacs-24.3-giflib5-interlace.patch
and include changes and corrected cpp boolean in
patch emacs-24.3-giflib5.diff
-------------------------------------------------------------------
Tue Sep 2 20:38:27 UTC 2014 - jengelh@inai.de

View File

@ -110,7 +110,6 @@ Patch20: CVE-2014-3424.patch
Patch22: emacs-24.1-bnc628268.patch
Patch25: emacs-24.3-giflib5.patch
Patch26: emacs-24.3-nntp-typhoon-fix.patch
Patch27: emacs-24.3-giflib5-interlace.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%{expand: %%global _exec_prefix %(type -p pkg-config &>/dev/null && pkg-config --variable prefix x11 || echo /usr/X11R6)}
%if "%_exec_prefix" == "/usr/X11R6"
@ -228,7 +227,6 @@ and most assembler-like syntaxes.
%patch22 -p0
%patch25 -p1
%patch26 -p1
%patch27 -p1
%if %{without autoconf}
# We don't want to run autoconf