From 3d5fa4735f6886f7e904cd87a9fb4f7e3d4264352619909ec4ac550432062f8a Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Wed, 16 Sep 2020 08:41:07 +0000 Subject: [PATCH] bad gif OBS-URL: https://build.opensuse.org/package/show/editors/emacs?expand=0&rev=294 --- emacs-27.1-gif.patch | 39 +++++++++++++++++++++++++++++++++++++++ emacs.changes | 7 +++++++ emacs.spec | 7 +++++-- 3 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 emacs-27.1-gif.patch diff --git a/emacs-27.1-gif.patch b/emacs-27.1-gif.patch new file mode 100644 index 0000000..9ed27dd --- /dev/null +++ b/emacs-27.1-gif.patch @@ -0,0 +1,39 @@ +>>>>> On Tue, 8 Sep 2020 20:38:30 +0700, nnoodle said: + + nnoodle> To reproduce: + nnoodle> $ echo 'GIF89a;' > bad.gif + nnoodle> $ emacs -Q bad.gif + + nnoodle> The result will be a segmentation fault. + +This should fix it, can you test it? + +Thanks + +Robert + +diff --git a/src/image.c b/src/image.c +index d8c34669cc..6e3b71a869 100644 +--- a/src/image.c ++++ b/src/image.c +@@ -8251,7 +8251,7 @@ gif_load (struct frame *f, struct image *img) + Lisp_Object specified_file = image_spec_value (img->spec, QCfile, NULL); + Lisp_Object specified_data = image_spec_value (img->spec, QCdata, NULL); + EMACS_INT idx; +- int gif_err; ++ int gif_err = 0; + + if (NILP (specified_data)) + { +@@ -8277,7 +8277,8 @@ gif_load (struct frame *f, struct image *img) + { + #if HAVE_GIFERRORSTRING + image_error ("Cannot open `%s': %s", +- file, build_string (GifErrorString (gif_err))); ++ file, gif_err ? build_string (GifErrorString (gif_err)) ++ : build_string ("Unknown error from gif library")); + #else + image_error ("Cannot open `%s'", file); + #endif + + diff --git a/emacs.changes b/emacs.changes index b5ff085..98dd621 100644 --- a/emacs.changes +++ b/emacs.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Tue Sep 15 11:30:04 UTC 2020 - Dr. Werner Fink + +- Add patch emacs-27.1-gif.patch from upstream mailimng list to fix + crash on broken gig files +- Corect group of el package as well as provide it as devel packages + ------------------------------------------------------------------- Fri Aug 28 13:38:54 UTC 2020 - Dr. Werner Fink diff --git a/emacs.spec b/emacs.spec index 070a427..22443e4 100644 --- a/emacs.spec +++ b/emacs.spec @@ -178,6 +178,7 @@ Patch24: emacs-25.2-ImageMagick7.patch Patch25: emacs-26.1-xft4x11.patch Patch26: emacs-27.1-pdftex.patch Patch27: emacs-27.1-home.patch +Patch28: emacs-27.1-gif.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build %{expand: %%global include_info %(test -s /usr/share/info/info.info* && echo 0 || echo 1)} @@ -242,8 +243,9 @@ Support. %package -n emacs-el Requires: emacs = %{version}-%{release} +Provides: emacs-devel = %{version}-%{release} Summary: Several Lisp Files for GNU Emacs -Group: Productivity/Text/Editors +Group: Development/Libraries/Other BuildArch: noarch %description -n emacs-el @@ -252,7 +254,7 @@ files are pre-byte compiled and therefore not necessary. %package -n emacs-info Summary: Info files for GNU Emacs -Group: Productivity/Text/Editors +Group: Documentation/Other %if 0%{?suse_version} <= 1500 Requires(post): %install_info_prereq Requires(preun): %install_info_prereq @@ -293,6 +295,7 @@ and most assembler-like syntaxes. %patch25 -p0 -b .xft %patch26 -p0 -b .fmt %patch27 -p0 -b .home +%patch28 -p1 -b .crash %patch -p0 -b .0 %if %{without tex4pdf} pushd etc/refcards/