diff options
Diffstat (limited to 'media-libs/gegl/files')
10 files changed, 438 insertions, 0 deletions
diff --git a/media-libs/gegl/files/0.1.6-ffmpeg.patch b/media-libs/gegl/files/0.1.6-ffmpeg.patch new file mode 100644 index 000000000000..51fb95d28c18 --- /dev/null +++ b/media-libs/gegl/files/0.1.6-ffmpeg.patch @@ -0,0 +1,33 @@ +diff -urN gegl-0.1.6.old//operations/external/ff-load.c gegl-0.1.6/operations/external/ff-load.c +--- gegl-0.1.6.old//operations/external/ff-load.c 2011-01-24 19:03:30.000000000 -0300 ++++ gegl-0.1.6/operations/external/ff-load.c 2011-05-04 09:59:48.910379742 -0300 +@@ -69,17 +69,17 @@ + { + switch (err) + { +- case AVERROR_NUMEXPECTED: ++ case AVERROR(EDOM): + g_warning ("%s: Incorrect image filename syntax.\n" + "Use '%%d' to specify the image number:\n" + " for img1.jpg, img2.jpg, ..., use 'img%%d.jpg';\n" + " for img001.jpg, img002.jpg, ..., use 'img%%03d.jpg'.\n", + filename); + break; +- case AVERROR_INVALIDDATA: ++ case AVERROR(EINVAL): + g_warning ("%s: Error while parsing header\n", filename); + break; +- case AVERROR_NOFMT: ++ case AVERROR(EILSEQ): + g_warning ("%s: Unknown format\n", filename); + break; + default: +@@ -278,7 +278,7 @@ + for (i = 0; i< p->ic->nb_streams; i++) + { + AVCodecContext *c = p->ic->streams[i]->codec; +- if (c->codec_type == CODEC_TYPE_VIDEO) ++ if (c->codec_type == AVMEDIA_TYPE_VIDEO) + { + p->video_st = p->ic->streams[i]; + p->video_stream = i; diff --git a/media-libs/gegl/files/gegl-0.0.22-locale_h.diff b/media-libs/gegl/files/gegl-0.0.22-locale_h.diff new file mode 100644 index 000000000000..a4a9707fc24b --- /dev/null +++ b/media-libs/gegl/files/gegl-0.0.22-locale_h.diff @@ -0,0 +1,10 @@ +--- gegl-0.0.22/gegl/gegl-init.c 2008-12-31 02:38:59.000000000 +0100 ++++ gegl-0.0.22-1/gegl/gegl-init.c 2009-01-14 22:21:41.000000000 +0100 +@@ -26,6 +26,7 @@ + #include <glib/gi18n-lib.h> + + #include <stdlib.h> ++#include <locale.h> + #ifdef HAVE_UNISTD_H + #include <unistd.h> + #endif diff --git a/media-libs/gegl/files/gegl-0.1.8-cve-2012-4433-4757cdf7.patch b/media-libs/gegl/files/gegl-0.1.8-cve-2012-4433-4757cdf7.patch new file mode 100644 index 000000000000..7bda5b065c0a --- /dev/null +++ b/media-libs/gegl/files/gegl-0.1.8-cve-2012-4433-4757cdf7.patch @@ -0,0 +1,74 @@ +From 3d3b1559cb34bc862f145c9880d156f6f2fe7b5f Mon Sep 17 00:00:00 2001 +From: Sebastian Pipping <sebastian@pipping.org> +Date: Sat, 17 Nov 2012 16:22:21 +0100 +Subject: [PATCH] ppm-load: CVE-2012-4433: add plausibility checks for header + fields + +"Port" of 4757cdf73d3675478d645a3ec8250ba02168a230 by Nils Philippsen from GEGL 0.2.0 to 0.1.8 +--- + operations/external/ppm-load.c | 33 ++++++++++++++++++++++++++++----- + 1 file changed, 28 insertions(+), 5 deletions(-) + +diff --git a/operations/external/ppm-load.c b/operations/external/ppm-load.c +index 6db6e5a..2d4f0ca 100644 +--- a/operations/external/ppm-load.c ++++ b/operations/external/ppm-load.c +@@ -36,6 +36,7 @@ gegl_chant_file_path (path, _("File"), "", _("Path of file to load.")) + #include "gegl-chant.h" + #include <stdio.h> + #include <stdlib.h> ++#include <errno.h> + + typedef enum { + PIXMAP_ASCII = 51, +@@ -44,8 +45,8 @@ typedef enum { + + typedef struct { + map_type type; +- gint width; +- gint height; ++ glong width; ++ glong height; + gsize numsamples; /* width * height * channels */ + gsize bpc; /* bytes per channel */ + guchar *data; +@@ -82,11 +83,33 @@ ppm_load_read_header(FILE *fp, + } + + /* Get Width and Height */ +- img->width = strtol (header,&ptr,0); +- img->height = atoi (ptr); ++ errno = 0; ++ img->width = strtol (header,&ptr,10); ++ if (errno) ++ { ++ g_warning ("Error reading width: %s", strerror(errno)); ++ return FALSE; ++ } ++ else if (img->width < 0) ++ { ++ g_warning ("Error: width is negative"); ++ return FALSE; ++ } ++ ++ img->height = strtol (ptr,&ptr,10); ++ if (errno) ++ { ++ g_warning ("Error reading height: %s", strerror(errno)); ++ return FALSE; ++ } ++ else if (img->width < 0) ++ { ++ g_warning ("Error: height is negative"); ++ return FALSE; ++ } + + retval = fgets (header,MAX_CHARS_IN_ROW,fp); +- maxval = strtol (header,&ptr,0); ++ maxval = strtol (header,&ptr,10); + + if ((maxval != 255) && (maxval != 65535)) + { +-- +1.7.12.4 + diff --git a/media-libs/gegl/files/gegl-0.2.0-cve-2012-4433-1e92e523.patch b/media-libs/gegl/files/gegl-0.2.0-cve-2012-4433-1e92e523.patch new file mode 100644 index 000000000000..0babb0f41c1b --- /dev/null +++ b/media-libs/gegl/files/gegl-0.2.0-cve-2012-4433-1e92e523.patch @@ -0,0 +1,68 @@ +From 1e92e5235ded0415d555aa86066b8e4041ee5a53 Mon Sep 17 00:00:00 2001 +From: Nils Philippsen <nils@redhat.com> +Date: Tue, 16 Oct 2012 14:58:27 +0000 +Subject: ppm-load: CVE-2012-4433: don't overflow memory allocation + +Carefully selected width/height values could cause the size of a later +allocation to overflow, resulting in a buffer much too small to store +the data which would then written beyond its end. +--- +diff --git a/operations/external/ppm-load.c b/operations/external/ppm-load.c +index efe6d56..3d6bce7 100644 +--- a/operations/external/ppm-load.c ++++ b/operations/external/ppm-load.c +@@ -84,7 +84,6 @@ ppm_load_read_header(FILE *fp, + /* Get Width and Height */ + img->width = strtol (header,&ptr,0); + img->height = atoi (ptr); +- img->numsamples = img->width * img->height * CHANNEL_COUNT; + + fgets (header,MAX_CHARS_IN_ROW,fp); + maxval = strtol (header,&ptr,0); +@@ -109,6 +108,16 @@ ppm_load_read_header(FILE *fp, + g_warning ("%s: Programmer stupidity error", G_STRLOC); + } + ++ /* Later on, img->numsamples is multiplied with img->bpc to allocate ++ * memory. Ensure it doesn't overflow. */ ++ if (!img->width || !img->height || ++ G_MAXSIZE / img->width / img->height / CHANNEL_COUNT < img->bpc) ++ { ++ g_warning ("Illegal width/height: %ld/%ld", img->width, img->height); ++ return FALSE; ++ } ++ img->numsamples = img->width * img->height * CHANNEL_COUNT; ++ + return TRUE; + } + +@@ -229,12 +238,24 @@ process (GeglOperation *operation, + if (!ppm_load_read_header (fp, &img)) + goto out; + +- rect.height = img.height; +- rect.width = img.width; +- + /* Allocating Array Size */ ++ ++ /* Should use g_try_malloc(), but this causes crashes elsewhere because the ++ * error signalled by returning FALSE isn't properly acted upon. Therefore ++ * g_malloc() is used here which aborts if the requested memory size can't be ++ * allocated causing a controlled crash. */ + img.data = (guchar*) g_malloc (img.numsamples * img.bpc); + ++ /* No-op without g_try_malloc(), see above. */ ++ if (! img.data) ++ { ++ g_warning ("Couldn't allocate %" G_GSIZE_FORMAT " bytes, giving up.", ((gsize)img.numsamples * img.bpc)); ++ goto out; ++ } ++ ++ rect.height = img.height; ++ rect.width = img.width; ++ + switch (img.bpc) + { + case 1: +-- +cgit v0.9.0.2 diff --git a/media-libs/gegl/files/gegl-0.2.0-cve-2012-4433-4757cdf7.patch b/media-libs/gegl/files/gegl-0.2.0-cve-2012-4433-4757cdf7.patch new file mode 100644 index 000000000000..f78557f5772a --- /dev/null +++ b/media-libs/gegl/files/gegl-0.2.0-cve-2012-4433-4757cdf7.patch @@ -0,0 +1,70 @@ +From 4757cdf73d3675478d645a3ec8250ba02168a230 Mon Sep 17 00:00:00 2001 +From: Nils Philippsen <nils@redhat.com> +Date: Tue, 16 Oct 2012 14:56:40 +0000 +Subject: ppm-load: CVE-2012-4433: add plausibility checks for header fields + +Refuse values that are non-decimal, negative or overflow the target +type. +--- +diff --git a/operations/external/ppm-load.c b/operations/external/ppm-load.c +index 3d6bce7..465096d 100644 +--- a/operations/external/ppm-load.c ++++ b/operations/external/ppm-load.c +@@ -36,6 +36,7 @@ gegl_chant_file_path (path, _("File"), "", _("Path of file to load.")) + #include "gegl-chant.h" + #include <stdio.h> + #include <stdlib.h> ++#include <errno.h> + + typedef enum { + PIXMAP_ASCII = 51, +@@ -44,8 +45,8 @@ typedef enum { + + typedef struct { + map_type type; +- gint width; +- gint height; ++ glong width; ++ glong height; + gsize numsamples; /* width * height * channels */ + gsize bpc; /* bytes per channel */ + guchar *data; +@@ -82,11 +83,33 @@ ppm_load_read_header(FILE *fp, + } + + /* Get Width and Height */ +- img->width = strtol (header,&ptr,0); +- img->height = atoi (ptr); ++ errno = 0; ++ img->width = strtol (header,&ptr,10); ++ if (errno) ++ { ++ g_warning ("Error reading width: %s", strerror(errno)); ++ return FALSE; ++ } ++ else if (img->width < 0) ++ { ++ g_warning ("Error: width is negative"); ++ return FALSE; ++ } ++ ++ img->height = strtol (ptr,&ptr,10); ++ if (errno) ++ { ++ g_warning ("Error reading height: %s", strerror(errno)); ++ return FALSE; ++ } ++ else if (img->width < 0) ++ { ++ g_warning ("Error: height is negative"); ++ return FALSE; ++ } + + fgets (header,MAX_CHARS_IN_ROW,fp); +- maxval = strtol (header,&ptr,0); ++ maxval = strtol (header,&ptr,10); + + if ((maxval != 255) && (maxval != 65535)) + { +-- +cgit v0.9.0.2 diff --git a/media-libs/gegl/files/gegl-0.2.0-ffmpeg-0.11.diff b/media-libs/gegl/files/gegl-0.2.0-ffmpeg-0.11.diff new file mode 100644 index 000000000000..8e9a328524c3 --- /dev/null +++ b/media-libs/gegl/files/gegl-0.2.0-ffmpeg-0.11.diff @@ -0,0 +1,57 @@ +From 97067622352e58f86a24851dacb1f5daa0762897 Mon Sep 17 00:00:00 2001 +From: nick black <nick.black@sprezzatech.com> +Date: Fri, 14 Dec 2012 04:11:16 +0000 +Subject: port gegl forward to libav 54 + +--- +diff --git a/operations/external/ff-load.c b/operations/external/ff-load.c +index 442ec5f..75d26e9 100644 +--- a/operations/external/ff-load.c ++++ b/operations/external/ff-load.c +@@ -137,7 +137,7 @@ ff_cleanup (GeglChantO *o) + if (p->enc) + avcodec_close (p->enc); + if (p->ic) +- av_close_input_file (p->ic); ++ avformat_close_input(&p->ic); + if (p->lavc_frame) + av_free (p->lavc_frame); + +@@ -216,9 +216,9 @@ decode_frame (GeglOperation *operation, + { + do + { +- if (av_read_packet (p->ic, &p->pkt) < 0) ++ if (av_read_frame (p->ic, &p->pkt) < 0) + { +- fprintf (stderr, "av_read_packet failed for %s\n", ++ fprintf (stderr, "av_read_frame failed for %s\n", + o->path); + return -1; + } +@@ -271,12 +271,12 @@ prepare (GeglOperation *operation) + gint err; + + ff_cleanup (o); +- err = av_open_input_file (&p->ic, o->path, NULL, 0, NULL); ++ err = avformat_open_input(&p->ic, o->path, NULL, 0); + if (err < 0) + { + print_error (o->path, err); + } +- err = av_find_stream_info (p->ic); ++ err = avformat_find_stream_info (p->ic, NULL); + if (err < 0) + { + g_warning ("ff-load: error finding stream info for %s", o->path); +@@ -312,7 +312,7 @@ prepare (GeglOperation *operation) + if (p->codec->capabilities & CODEC_CAP_TRUNCATED) + p->enc->flags |= CODEC_FLAG_TRUNCATED; + +- if (avcodec_open (p->enc, p->codec) < 0) ++ if (avcodec_open2 (p->enc, p->codec, NULL) < 0) + { + g_warning ("error opening codec %s", p->enc->codec->name); + return; +-- +cgit v0.9.1 diff --git a/media-libs/gegl/files/gegl-0.2.0-g_log_domain.patch b/media-libs/gegl/files/gegl-0.2.0-g_log_domain.patch new file mode 100644 index 000000000000..cdb42b2ca5f2 --- /dev/null +++ b/media-libs/gegl/files/gegl-0.2.0-g_log_domain.patch @@ -0,0 +1,25 @@ +From deaa974528ac1f4099d091a333214b1a50147243 Mon Sep 17 00:00:00 2001 +From: Sebastian Pipping <sebastian@pipping.org> +Date: Wed, 1 May 2013 00:39:42 +0200 +Subject: [PATCH] Prevent double escaping / error "stray ‘\’ in program" + +--- + gegl/Makefile.am | 1 + + 1 file changed, 1 insertion(+), 0 deletion(-) + +diff --git a/gegl/Makefile.am b/gegl/Makefile.am +index 43010ce..fd046d2 100644 +--- a/gegl/Makefile.am ++++ b/gegl/Makefile.am +@@ -119,7 +119,8 @@ INCLUDES = $(AM_CFLAGS) $(AM_CPPFLAGS) + + Gegl-@GEGL_API_VERSION@.gir: libgegl-@GEGL_API_VERSION@.la Makefile + Gegl_@GEGL_MAJOR_VERSION@_@GEGL_MINOR_VERSION@_gir_INCLUDES = GObject-2.0 GLib-2.0 Babl-0.1 + Gegl_@GEGL_MAJOR_VERSION@_@GEGL_MINOR_VERSION@_gir_CFLAGS = $(INCLUDES) ++INTROSPECTION_SCANNER_ENV = CFLAGS="${CFLAGS} "-D'G_LOG_DOMAIN="GEGL-"__FILE__' # No extra backslashes here! + Gegl_@GEGL_MAJOR_VERSION@_@GEGL_MINOR_VERSION@_gir_LIBS = libgegl-@GEGL_API_VERSION@.la + Gegl_@GEGL_MAJOR_VERSION@_@GEGL_MINOR_VERSION@_gir_FILES = $(introspection_sources) + INTROSPECTION_GIRS += Gegl-@GEGL_API_VERSION@.gir +-- +1.8.1.5 + diff --git a/media-libs/gegl/files/gegl-0.2.0-introspection-version.patch b/media-libs/gegl/files/gegl-0.2.0-introspection-version.patch new file mode 100644 index 000000000000..1ac28dc62964 --- /dev/null +++ b/media-libs/gegl/files/gegl-0.2.0-introspection-version.patch @@ -0,0 +1,31 @@ +From 35469116fbf0b398d748f8116e4dcc8bdaee12c7 Mon Sep 17 00:00:00 2001 +From: Jon Nordby <jononor@gmail.com> +Date: Thu, 12 Apr 2012 12:10:05 +0000 +Subject: gobject-introspection: Fix build after 0.2.x version bump + +Remove hardcoding of version numbers so that this does +not happen again. +--- +(limited to 'gegl/Makefile.am') + +diff --git a/gegl/Makefile.am b/gegl/Makefile.am +index aef4c33..43010ce 100644 +--- a/gegl/Makefile.am ++++ b/gegl/Makefile.am +@@ -118,10 +118,10 @@ introspection_sources = \ + INCLUDES = $(AM_CFLAGS) $(AM_CPPFLAGS) + + Gegl-@GEGL_API_VERSION@.gir: libgegl-@GEGL_API_VERSION@.la Makefile +-Gegl_0_1_gir_INCLUDES = GObject-2.0 GLib-2.0 Babl-0.1 +-Gegl_0_1_gir_CFLAGS = $(INCLUDES) +-Gegl_0_1_gir_LIBS = libgegl-@GEGL_API_VERSION@.la +-Gegl_0_1_gir_FILES = $(introspection_sources) ++Gegl_@GEGL_MAJOR_VERSION@_@GEGL_MINOR_VERSION@_gir_INCLUDES = GObject-2.0 GLib-2.0 Babl-0.1 ++Gegl_@GEGL_MAJOR_VERSION@_@GEGL_MINOR_VERSION@_gir_CFLAGS = $(INCLUDES) ++Gegl_@GEGL_MAJOR_VERSION@_@GEGL_MINOR_VERSION@_gir_LIBS = libgegl-@GEGL_API_VERSION@.la ++Gegl_@GEGL_MAJOR_VERSION@_@GEGL_MINOR_VERSION@_gir_FILES = $(introspection_sources) + INTROSPECTION_GIRS += Gegl-@GEGL_API_VERSION@.gir + + girdir = $(datadir)/gir-1.0 +-- +cgit v0.9.1 diff --git a/media-libs/gegl/files/gegl-doubledestdir.diff b/media-libs/gegl/files/gegl-doubledestdir.diff new file mode 100644 index 000000000000..8a9bf33461c9 --- /dev/null +++ b/media-libs/gegl/files/gegl-doubledestdir.diff @@ -0,0 +1,12 @@ +diff -Naur gegl-0.1.6/docs/Makefile.am gegl-0.1.6-1//docs/Makefile.am +--- gegl-0.1.6/docs/Makefile.am 2010-10-08 18:51:41.000000000 +0200 ++++ gegl-0.1.6-1//docs/Makefile.am 2011-02-16 20:05:30.458043758 +0100 +@@ -6,7 +6,7 @@ + # is very small, and should probably be documented in a tutorial. + # + +-gtkdochtmldir = $(DESTDIR)$(datadir)/gtk-doc/html/gegl ++gtkdochtmldir = $(datadir)/gtk-doc/html/gegl + + HTML_FILES = \ + operations.html \ diff --git a/media-libs/gegl/files/replace-imgconvert-by-swsscale.patch b/media-libs/gegl/files/replace-imgconvert-by-swsscale.patch new file mode 100644 index 000000000000..2cf5601e1665 --- /dev/null +++ b/media-libs/gegl/files/replace-imgconvert-by-swsscale.patch @@ -0,0 +1,58 @@ +Index: gegl-0.0.22/operations/workshop/external/ff-save.c +=================================================================== +--- gegl-0.0.22.orig/operations/workshop/external/ff-save.c ++++ gegl-0.0.22/operations/workshop/external/ff-save.c +@@ -19,6 +19,8 @@ + #include "config.h" + #include <glib/gi18n-lib.h> + ++#include <libswscale/swscale.h> ++ + + #ifdef GEGL_CHANT_PROPERTIES + +@@ -640,6 +642,7 @@ write_video_frame (GeglChantO *op, + int out_size, ret; + AVCodecContext *c; + AVFrame *picture_ptr; ++ struct SwsContext *img_convert_ctx; + + c = st->codec; + +@@ -649,10 +652,22 @@ write_video_frame (GeglChantO *op, + to the codec pixel format if needed */ + fill_yuv_image (op, p->tmp_picture, p->frame_count, c->width, + c->height); +- /* FIXME: img_convert is deprecated. Update code to use sws_scale(). */ ++ /* FIXME: img_convert is deprecated. Update code to use sws_scale(). + img_convert ((AVPicture *) p->picture, c->pix_fmt, + (AVPicture *) p->tmp_picture, PIX_FMT_RGB24, + c->width, c->height); ++ */ ++ img_convert_ctx = sws_getContext(c->width, c->height, c->pix_fmt, ++ c->width, c->height, PIX_FMT_RGB24, ++ SWS_BICUBIC, NULL, NULL, NULL); ++ ++ if (img_convert_ctx == NULL) ++ fprintf(stderr, "ff_save: Cannot initialize conversion context."); ++ else ++ { ++ sws_scale(img_convert_ctx, p->tmp_picture->data, p->tmp_picture->linesize, ++ 0, c->height, p->picture->data, p->picture->linesize); ++ } + } + else + { +Index: gegl-0.0.22/operations/workshop/external/Makefile.am +=================================================================== +--- gegl-0.0.22.orig/operations/workshop/external/Makefile.am ++++ gegl-0.0.22/operations/workshop/external/Makefile.am +@@ -21,7 +21,7 @@ endif + if HAVE_AVFORMAT + ops += ff_save.la + ff_save_la_SOURCES = ff-save.c +-ff_save_la_LIBADD = $(op_libs) $(AVFORMAT_LIBS) ++ff_save_la_LIBADD = $(op_libs) $(AVFORMAT_LIBS) -lswscale + ff_save_la_CFLAGS = $(AVFORMAT_CFLAGS) + endif + |