From 4304d6ae9c232ac264e1f0c2bc69bd296f459732 Mon Sep 17 00:00:00 2001 From: markd Date: Tue, 13 Nov 2018 10:18:26 +0000 Subject: [PATCH] ming: update to 0.4.8 7 Apr 2017 - Ming 0.4.8 * Add PHP7 compatibility * Fix C++ output of disassembler * Fix heap overflows in parser.c (CVE-2017-7578) * Avoid division by zero in listmp3 when no valid frame was found * Don't try printing unknown block. * Parse Protect tag's Password as string * Check values before deriving malloc parameters from them in parser.c * Make readString() stop reading string past buffer's end * Return EOF when reading unsigned values hits end of memory backed buffer * Exit immediately when unexpected EOF is by fgetc() in utility programs * Fix using EOF marker -1 value as a valid flag byte * Fix division by zero sample rate due to global buffer overflow. 15 May 2015 - Ming 0.4.7 * Restore support for giflib 4.1.x 14 May 2015 - Ming 0.4.6 * Add support for building against giflib 5.1.1+ * Fix support for bison 2.6+ * Fix build on GNU/Hurd(PR #39). * Fix possible buffer overflow in makeswf * Change php bindings license from PHP to LGPL-2.1+ * Fix build of python binding with libgif (rather than libungif) --- multimedia/ming/Makefile | 8 +- multimedia/ming/Makefile.common | 10 +- multimedia/ming/PLIST | 149 +++++- multimedia/ming/distinfo | 17 +- multimedia/ming/patches/patch-ae | 15 - multimedia/ming/patches/patch-configure.in | 41 ++ multimedia/ming/patches/patch-php__ext_ming.c | 483 ------------------ .../ming/patches/patch-src_blocks_gifdbl.c | 45 -- multimedia/ming/patches/patch-src_libming.h | 41 -- multimedia/ming/patches/patch-util_gif2dbl.c | 64 --- multimedia/ming/patches/patch-util_gif2mask.c | 49 -- 11 files changed, 207 insertions(+), 715 deletions(-) delete mode 100644 multimedia/ming/patches/patch-ae create mode 100644 multimedia/ming/patches/patch-configure.in delete mode 100644 multimedia/ming/patches/patch-php__ext_ming.c delete mode 100644 multimedia/ming/patches/patch-src_blocks_gifdbl.c delete mode 100644 multimedia/ming/patches/patch-src_libming.h delete mode 100644 multimedia/ming/patches/patch-util_gif2dbl.c delete mode 100644 multimedia/ming/patches/patch-util_gif2mask.c diff --git a/multimedia/ming/Makefile b/multimedia/ming/Makefile index d0db603bf9cd..4b1bb9e9859a 100644 --- a/multimedia/ming/Makefile +++ b/multimedia/ming/Makefile @@ -1,9 +1,9 @@ -# $NetBSD: Makefile,v 1.27 2018/08/22 09:45:49 wiz Exp $ +# $NetBSD: Makefile,v 1.28 2018/11/13 10:18:26 markd Exp $ # .include "Makefile.common" -PKGREVISION= 7 +PKGNAME= ${DISTNAME:S/_/./g} CATEGORIES= multimedia MAINTAINER= pkgsrc-users@NetBSD.org @@ -13,6 +13,7 @@ LICENSE= gnu-lgpl-v2.1 AND gnu-gpl-v2 GNU_CONFIGURE= yes USE_TOOLS+= pkg-config bison flex +USE_TOOLS+= aclocal autoconf automake autoheader USE_LANGUAGES= c c++ USE_LIBTOOL= yes @@ -34,6 +35,9 @@ TEST_TARGET= check # XXX: "man" is not in SUBDIRS of "docs" INSTALL_DIRS= . docs/man +pre-configure: + cd ${WRKSRC}; sh ./autogen.sh + .include "../../devel/zlib/buildlink3.mk" .include "../../graphics/freetype2/buildlink3.mk" .include "../../graphics/giflib/buildlink3.mk" diff --git a/multimedia/ming/Makefile.common b/multimedia/ming/Makefile.common index 310672c7aa0a..efecf1f36038 100644 --- a/multimedia/ming/Makefile.common +++ b/multimedia/ming/Makefile.common @@ -1,11 +1,13 @@ -# $NetBSD: Makefile.common,v 1.7 2013/06/14 09:00:19 obache Exp $ +# $NetBSD: Makefile.common,v 1.8 2018/11/13 10:18:26 markd Exp $ # # used by multimedia/php-ming/Makefile # used by multimedia/py-ming/Makefile -MING_VERSION= 0.4.5 -DISTNAME= ming-${MING_VERSION} -MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=ming/} +MING_VERSION= 0.4.8 +DISTNAME= ming-${MING_VERSION:S/./_/g} +MASTER_SITES= ${MASTER_SITE_GITHUB:=libming/libming/archive/} DISTINFO_FILE= ${.CURDIR}/../../multimedia/ming/distinfo PATCHDIR= ${.CURDIR}/../../multimedia/ming/patches + +WRKSRC= ${WRKDIR}/libming-ming-${MING_VERSION:S/./_/g} diff --git a/multimedia/ming/PLIST b/multimedia/ming/PLIST index 827010ee1e06..f7714ebd54ad 100644 --- a/multimedia/ming/PLIST +++ b/multimedia/ming/PLIST @@ -1,4 +1,4 @@ -@comment $NetBSD: PLIST,v 1.3 2010/04/09 01:33:43 obache Exp $ +@comment $NetBSD: PLIST,v 1.4 2018/11/13 10:18:26 markd Exp $ bin/dbl2png bin/gif2dbl bin/gif2mask @@ -46,31 +46,178 @@ man/man3/Ming_setSWFCompression.3 man/man3/Ming_setScale.3 man/man3/Ming_setWarnFunction.3 man/man3/Ming_useSWFVersion.3 +man/man3/SWFAction_compile.3 +man/man3/SWFAction_getByteCode.3 +man/man3/SWFAction_setDebug.3 +man/man3/SWFBlockList_getLastBlock.3 +man/man3/SWFBlock_isCharacter.3 +man/man3/SWFButtonRecord_addFilter.3 +man/man3/SWFButtonRecord_setBlendMode.3 +man/man3/SWFButton_addAction.3 +man/man3/SWFButton_addCharacter.3 +man/man3/SWFButton_addShape.3 +man/man3/SWFButton_removeScalingGrid.3 +man/man3/SWFButton_setScalingGrid.3 +man/man3/SWFCXform_setColorAdd.3 +man/man3/SWFCXform_setColorMult.3 +man/man3/SWFCharacter_getHeight.3 +man/man3/SWFCharacter_getWidth.3 man/man3/SWFDisplayItem_addFilter.3 man/man3/SWFDisplayItem_cacheAsBitmap.3 +man/man3/SWFDisplayItem_flush.3 man/man3/SWFDisplayItem_get_x.3 man/man3/SWFDisplayItem_setBlendMode.3 +man/man3/SWFDisplayItem_setMaskLevel.3 +man/man3/SWFDisplayItem_setName.3 +man/man3/SWFFontCharacter_addAllChars.3 +man/man3/SWFFontCharacter_addChars.3 +man/man3/SWFFontCharacter_addUTF8Chars.3 +man/man3/SWFFont_getScaledAscent.3 +man/man3/SWFGradient_addEntry.3 +man/man3/SWFGradient_setFocalPoint.3 +man/man3/SWFGradient_setInterpolationMode.3 +man/man3/SWFGradient_setSpreadMode.3 +man/man3/SWFMatrix_leftMultiply.3 +man/man3/SWFMatrix_multiply.3 +man/man3/SWFMovieClip_add.3 +man/man3/SWFMovieClip_addInitAction.3 +man/man3/SWFMovieClip_labelFrame.3 +man/man3/SWFMovieClip_nextFrame.3 +man/man3/SWFMovieClip_remove.3 +man/man3/SWFMovieClip_removeScalingGrid.3 +man/man3/SWFMovieClip_setNumberOfFrames.3 +man/man3/SWFMovieClip_setScalingGrid.3 +man/man3/SWFMovieClip_setSoundStream.3 +man/man3/SWFMovieClip_setSoundStreamAt.3 +man/man3/SWFMovieClip_startSound.3 +man/man3/SWFMovieClip_stopSound.3 man/man3/SWFMovie_add.3 +man/man3/SWFMovie_addExport.3 +man/man3/SWFMovie_addFont.3 +man/man3/SWFMovie_addMetadata.3 +man/man3/SWFMovie_add_internal.3 +man/man3/SWFMovie_assignSymbol.3 +man/man3/SWFMovie_defineScene.3 +man/man3/SWFMovie_getRate.3 +man/man3/SWFMovie_importCharacter.3 +man/man3/SWFMovie_importFont.3 man/man3/SWFMovie_labelFrame.3 man/man3/SWFMovie_namedAnchor.3 +man/man3/SWFMovie_nextFrame.3 +man/man3/SWFMovie_output.3 +man/man3/SWFMovie_output_to_stream.3 man/man3/SWFMovie_protect.3 +man/man3/SWFMovie_remove.3 +man/man3/SWFMovie_replace_internal.3 +man/man3/SWFMovie_save.3 man/man3/SWFMovie_setBackground.3 man/man3/SWFMovie_setDimension.3 +man/man3/SWFMovie_setNetworkAccess.3 man/man3/SWFMovie_setNumberOfFrames.3 man/man3/SWFMovie_setRate.3 +man/man3/SWFMovie_setScriptLimits.3 +man/man3/SWFMovie_setSoundStream.3 +man/man3/SWFMovie_setSoundStreamAt.3 +man/man3/SWFMovie_setTabIndex.3 +man/man3/SWFMovie_startSound.3 +man/man3/SWFMovie_stopSound.3 +man/man3/SWFMovie_writeExports.3 +man/man3/SWFOutput_checkSize.3 +man/man3/SWFOutput_writeFloat16.3 +man/man3/SWFPlaceObject2Block_addFilter.3 +man/man3/SWFPlaceObject2Block_setBlendMode.3 +man/man3/SWFPlaceObject2Block_setCacheFlag.3 +man/man3/SWFRect_includePoint.3 man/man3/SWFShape_drawArc.3 man/man3/SWFShape_drawCubic.3 man/man3/SWFShape_drawScaledLineTo.3 +man/man3/SWFShape_getVersion.3 man/man3/SWFShape_movePenTo.3 man/man3/SWFShape_moveScaledPenTo.3 +man/man3/SWFShape_setLine.3 +man/man3/SWFShape_setLine2.3 +man/man3/SWFShape_setLine2Filled.3 +man/man3/SWFShape_setLineStyle2_internal.3 +man/man3/SWFShape_setLineStyle2filled_internal.3 +man/man3/SWFShape_setLineStyle_internal.3 +man/man3/SWFShape_setRenderHintingFlags.3 +man/man3/SWFShape_useVersion.3 +man/man3/SWFSoundInstance_addEnvelope.3 +man/man3/SWFSoundInstance_setLoopCount.3 +man/man3/SWFSoundInstance_setLoopInPoint.3 +man/man3/SWFSoundInstance_setLoopOutPoint.3 +man/man3/SWFSoundInstance_setNoMultiple.3 +man/man3/SWFSoundStream_getDuration.3 +man/man3/SWFSoundStream_getFrames.3 +man/man3/SWFSoundStream_rewind.3 +man/man3/SWFTextField_setFont.3 +man/man3/SWFTextField_setFontCharacter.3 +man/man3/SWFText_addWideString.3 +man/man3/SWFText_resolveCodes.3 man/man3/SWFVideoStream_getNumFrames.3 man/man3/SWFVideoStream_getVideoFrame.3 man/man3/SWFVideoStream_hasAudio.3 +man/man3/SWFVideoStream_nextFrame.3 +man/man3/SWFVideoStream_seek.3 man/man3/SWFVideoStream_setDimension.3 +man/man3/SWFVideoStream_setFrameMode.3 +man/man3/destroySWFAction.3 +man/man3/destroySWFBinaryData.3 +man/man3/destroySWFBitmap.3 +man/man3/destroySWFBrowserFont.3 +man/man3/destroySWFCXform.3 man/man3/destroySWFMovie.3 +man/man3/destroySWFMovieClip.3 +man/man3/destroySWFPrebuiltClip.3 +man/man3/destroySWFSoundInstance.3 +man/man3/dumpJpegBlock.3 +man/man3/getMP3Duration.3 +man/man3/getMP3Flags.3 +man/man3/newBevelFilter.3 +man/man3/newBlurFilter.3 +man/man3/newColorMatrixFilter.3 +man/man3/newConvolutionFilter.3 +man/man3/newDropShadowFilter.3 +man/man3/newGlowFilter.3 +man/man3/newGradientBevelFilter.3 +man/man3/newGradientGlowFilter.3 +man/man3/newSWFAction.3 +man/man3/newSWFAction_fromFile.3 +man/man3/newSWFAddCXform.3 +man/man3/newSWFBinaryData.3 +man/man3/newSWFBlur.3 +man/man3/newSWFBrowserFont.3 +man/man3/newSWFCXform.3 +man/man3/newSWFFilterMatrix.3 +man/man3/newSWFFontCollection_fromFile.3 +man/man3/newSWFFont_fromFile.3 +man/man3/newSWFInitAction.3 +man/man3/newSWFInitAction_withId.3 +man/man3/newSWFInput_allocedBuffer.3 +man/man3/newSWFInput_bufferCopy.3 +man/man3/newSWFJpegWithAlpha_fromInput.3 +man/man3/newSWFLineStyle.3 +man/man3/newSWFLineStyle2.3 +man/man3/newSWFLineStyle2_filled.3 +man/man3/newSWFMatrix.3 man/man3/newSWFMovie.3 +man/man3/newSWFMovieClip.3 man/man3/newSWFMovieWithVersion.3 +man/man3/newSWFMultCXform.3 +man/man3/newSWFPlaceObjectBlock.3 +man/man3/newSWFPosition.3 +man/man3/newSWFPrebuiltClip_fromFile.3 +man/man3/newSWFPrebuiltClip_fromInput.3 +man/man3/newSWFShadow.3 man/man3/newSWFShapeFromBitmap.3 +man/man3/newSWFSound.3 +man/man3/newSWFSoundFromFileno.3 +man/man3/newSWFSoundInstance.3 +man/man3/newSWFSound_fromSoundStream.3 +man/man3/newSWFText2.3 man/man3/newSWFVideoStream.3 man/man3/newSWFVideoStream_fromFile.3 man/man3/newSWFVideoStream_fromInput.3 +man/man3/newSizedSWFOutput.3 +man/man3/readMP3Header.3 +man/man3/writeSWFButtonSoundToMethod.3 diff --git a/multimedia/ming/distinfo b/multimedia/ming/distinfo index 33cde0fb1fbe..892dcc7495a0 100644 --- a/multimedia/ming/distinfo +++ b/multimedia/ming/distinfo @@ -1,12 +1,7 @@ -$NetBSD: distinfo,v 1.17 2015/11/03 23:54:30 agc Exp $ +$NetBSD: distinfo,v 1.18 2018/11/13 10:18:26 markd Exp $ -SHA1 (ming-0.4.5.tar.gz) = 97c201040729917bf7c62da9616a87f4a920f473 -RMD160 (ming-0.4.5.tar.gz) = 9ef9cf769a03c6e356dca299c85e06a2cdd6a155 -SHA512 (ming-0.4.5.tar.gz) = c7b8ef7769fabfde792ad58d9d72fea380dd3091b4ef52d4779a2b28ec742ddcbeb6c69ed119cd19543554f4c1d01aa4e50e87509f495e83272a33b3c4b920c0 -Size (ming-0.4.5.tar.gz) = 15029578 bytes -SHA1 (patch-ae) = 614e322330d2d2ab1e0ef1beadf1395014ecd880 -SHA1 (patch-php__ext_ming.c) = a6f0231a602e39b638c5c8f369e2747c978f9762 -SHA1 (patch-src_blocks_gifdbl.c) = 212535b773d373a9836facb9bbc248749ca9d552 -SHA1 (patch-src_libming.h) = bba5e6f93913359b7109e3b18177f819989be98f -SHA1 (patch-util_gif2dbl.c) = bd897674d5146ac6d6c2b4df6399f18e283c22e6 -SHA1 (patch-util_gif2mask.c) = b98e2bcbbf6e3237acf71aaa02f3e36f6fb62dfd +SHA1 (ming-0_4_8.tar.gz) = ef94923ea4f71fca0950c4a9ff1eb33e1712c17b +RMD160 (ming-0_4_8.tar.gz) = 4110608567c768bb67338c4bd3967322e63c32d4 +SHA512 (ming-0_4_8.tar.gz) = e395acde9119ad32f4cedd500bcceee70bdd563222a41dda899cc318d5e34eb580abc38ac39c6dec7821913a0a70d2f953fc81f52255b623e34f7c3aaafbc9c0 +Size (ming-0_4_8.tar.gz) = 14908459 bytes +SHA1 (patch-configure.in) = 9c231dc2e06d12e05b8e82d48f1df2aed33de697 diff --git a/multimedia/ming/patches/patch-ae b/multimedia/ming/patches/patch-ae deleted file mode 100644 index 20ba9f824d7f..000000000000 --- a/multimedia/ming/patches/patch-ae +++ /dev/null @@ -1,15 +0,0 @@ -$NetBSD: patch-ae,v 1.3 2011/02/15 05:37:29 obache Exp $ - -* tolower needs unsigned char argument. - ---- src/actioncompiler/compile.c.orig 2008-04-10 22:32:47.000000000 +0000 -+++ src/actioncompiler/compile.c -@@ -595,7 +595,7 @@ void lower(char *s) - { - while(*s) - { -- *s = tolower(*s); -+ *s = tolower((unsigned char)*s); - ++s; - } - } diff --git a/multimedia/ming/patches/patch-configure.in b/multimedia/ming/patches/patch-configure.in new file mode 100644 index 000000000000..5245bcf78335 --- /dev/null +++ b/multimedia/ming/patches/patch-configure.in @@ -0,0 +1,41 @@ +$NetBSD: patch-configure.in,v 1.1 2018/11/13 10:18:26 markd Exp $ + +From ef3719d39e8bb7e96c6ec57d60261f1516353460 Mon Sep 17 00:00:00 2001 +From: Lars Wendler +Date: Fri, 4 May 2018 17:40:04 +0200 +Subject: [PATCH] Use pkg-config to find freetype + +As of freetype-2.9.1 the freetype-config script has been deprecated and +is no longer shipped by default. + +--- configure.in.orig 2017-04-07 08:12:56.000000000 +0000 ++++ configure.in +@@ -257,26 +257,8 @@ freetype_support=yes) + + if test "$freetype_support" = "yes"; then + dnl Check for the freetype library +- AC_ARG_WITH(freetype-config, [ --with-freetype-config=PROG Use FreeType configuration program PROG], freetype_config=$withval, freetype_config=yes) +- if test "$freetype_config" = "yes"; then +- AC_PATH_PROG(ft_config,freetype-config,no) +- if test "$ft_config" = "no"; then +- echo "To compile ming please install freetype:" +- echo " as .deb user: sudo apt-get install libfreetype6 libfreetype6-dev" +- echo "" +- echo "or disable the freetype configuration option:" +- echo " --disable-freetype" +- AC_MSG_ERROR([Could not detect freetype-config!]) +- fi +- else +- ft_config="$freetype_config" +- fi +- +- FREETYPE_CFLAGS="`$ft_config --cflags`" +- FREETYPE_LIBS="`$ft_config --libs`" +- +- AC_SUBST(FREETYPE_LIBS) +- AC_SUBST(FREETYPE_CFLAGS) ++ PKG_PROG_PKG_CONFIG ++ PKG_CHECK_MODULES(FREETYPE, freetype2,, AC_MSG_ERROR([Could not find freetype])) + fi + + dnl Check for the ungif or gif (new or old) libraries diff --git a/multimedia/ming/patches/patch-php__ext_ming.c b/multimedia/ming/patches/patch-php__ext_ming.c deleted file mode 100644 index ef0936f71a52..000000000000 --- a/multimedia/ming/patches/patch-php__ext_ming.c +++ /dev/null @@ -1,483 +0,0 @@ -$NetBSD: patch-php__ext_ming.c,v 1.3 2015/08/29 15:46:14 taca Exp $ - -* Fix build problem with maintainer-zts PKG_OPTIONS. - ---- php_ext/ming.c.orig 2013-06-08 14:46:45.000000000 +0000 -+++ php_ext/ming.c -@@ -370,7 +370,7 @@ static SWFInput getInput_fromFileResourc - - input = newSWFInput_file(file); - zend_list_addref(Z_LVAL_P(zfile)); -- zend_list_addref(zend_list_insert(input, le_swfinputp)); -+ zend_list_addref(zend_list_insert(input, le_swfinputp TSRMLS_CC)); - return input; - } - /* }}} */ -@@ -410,7 +410,7 @@ PHP_METHOD(swfinput, __construct) - - input = newSWFInput_bufferCopy((unsigned char *)data, data_len); - -- ret = zend_list_insert(input, le_swfinputp); -+ ret = zend_list_insert(input, le_swfinputp TSRMLS_CC); - object_init_ex(getThis(), input_class_entry_ptr); - add_property_resource(getThis(), "input", ret); - zend_list_addref(ret); -@@ -449,7 +449,7 @@ PHP_METHOD(swffontcollection, __construc - - fc = newSWFFontCollection_fromFile(filename); - if(fc) { -- ret = zend_list_insert(fc, le_swffontcollectionp); -+ ret = zend_list_insert(fc, le_swffontcollectionp TSRMLS_CC); - object_init_ex(getThis(), fontcollection_class_entry_ptr); - add_property_resource(getThis(), "fontcollection", ret); - zend_list_addref(ret); -@@ -479,7 +479,7 @@ PHP_METHOD(swffontcollection, getFont) - font = SWFFontCollection_getFont(getFontCollection(getThis() TSRMLS_CC), index); - - if(font != NULL) { -- ret = zend_list_insert(font, le_swffontp); -+ ret = zend_list_insert(font, le_swffontp TSRMLS_CC); - object_init_ex(return_value, font_class_entry_ptr); - add_property_resource(return_value, "font", ret); - zend_list_addref(ret); -@@ -527,7 +527,7 @@ PHP_METHOD(swfbrowserfont, __construct) - - font = newSWFBrowserFont(name); - if(font) { -- ret = zend_list_insert(font, le_swfbrowserfontp); -+ ret = zend_list_insert(font, le_swfbrowserfontp TSRMLS_CC); - object_init_ex(getThis(), browserfont_class_entry_ptr); - add_property_resource(getThis(), "browserfont", ret); - zend_list_addref(ret); -@@ -573,7 +573,7 @@ PHP_METHOD(swfcxform, __construct) - WRONG_PARAM_COUNT; - } - -- ret = zend_list_insert(cx, le_swfcxformp); -+ ret = zend_list_insert(cx, le_swfcxformp TSRMLS_CC); - object_init_ex(getThis(), cxform_class_entry_ptr); - add_property_resource(getThis(), "cx", ret); - zend_list_addref(ret); -@@ -736,7 +736,7 @@ PHP_METHOD(swfinitaction, __construct) - init = newSWFInitAction_withId(getAction(zaction TSRMLS_CC), id); - } - -- ret = zend_list_insert(init, le_swfinitactionp); -+ ret = zend_list_insert(init, le_swfinitactionp TSRMLS_CC); - object_init_ex(getThis(), initaction_class_entry_ptr); - add_property_resource(getThis(), "initaction", ret); - zend_list_addref(ret); -@@ -785,7 +785,7 @@ PHP_METHOD(swfaction, __construct) - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Couldn't compile actionscript"); - } - -- ret = zend_list_insert(action, le_swfactionp); -+ ret = zend_list_insert(action, le_swfactionp TSRMLS_CC); - - object_init_ex(getThis(), action_class_entry_ptr); - add_property_resource(getThis(), "action", ret); -@@ -863,7 +863,7 @@ PHP_METHOD(swfbitmap, __construct) - input = newSWFInput_filename(Z_STRVAL_P(zfile)); - if(input == NULL) - php_error(E_ERROR, "opening bitmap file failed"); -- zend_list_addref(zend_list_insert(input, le_swfinputp)); -+ zend_list_addref(zend_list_insert(input, le_swfinputp TSRMLS_CC)); - break; - - default: -@@ -884,7 +884,7 @@ PHP_METHOD(swfbitmap, __construct) - maskinput = newSWFInput_filename(Z_STRVAL_P(zmask)); - if(maskinput == NULL) - php_error(E_ERROR, "opening mask file failed"); -- zend_list_addref(zend_list_insert(maskinput, le_swfinputp)); -+ zend_list_addref(zend_list_insert(maskinput, le_swfinputp TSRMLS_CC)); - break; - - default: -@@ -895,7 +895,7 @@ PHP_METHOD(swfbitmap, __construct) - /* XXX: this is very optimistic! is it really a JPEG ?!? */ - bitmap_alpha = newSWFJpegWithAlpha_fromInput(input, maskinput); - if(bitmap_alpha) { -- ret = zend_list_insert(bitmap_alpha, le_swfbitmapp); -+ ret = zend_list_insert(bitmap_alpha, le_swfbitmapp TSRMLS_CC); - object_init_ex(getThis(), bitmap_class_entry_ptr); - add_property_resource(getThis(), "bitmap", ret); - zend_list_addref(ret); -@@ -903,7 +903,7 @@ PHP_METHOD(swfbitmap, __construct) - } else { - bitmap = newSWFBitmap_fromInput(input); - if(bitmap) { -- ret = zend_list_insert(bitmap, le_swfbitmapp); -+ ret = zend_list_insert(bitmap, le_swfbitmapp TSRMLS_CC); - object_init_ex(getThis(), bitmap_class_entry_ptr); - add_property_resource(getThis(), "bitmap", ret); - zend_list_addref(ret); -@@ -1164,7 +1164,7 @@ static zend_function_entry swfbuttonreco - PHP_METHOD(swfbutton, __construct) - { - SWFButton button = newSWFButton(); -- int ret = zend_list_insert(button, le_swfbuttonp); -+ int ret = zend_list_insert(button, le_swfbuttonp TSRMLS_CC); - - object_init_ex(getThis(), button_class_entry_ptr); - add_property_resource(getThis(), "button", ret); -@@ -1297,7 +1297,7 @@ PHP_METHOD(swfbutton, addCharacter) - - if(record != NULL) - { -- ret = zend_list_insert(record, le_swfbuttonrecordp); -+ ret = zend_list_insert(record, le_swfbuttonrecordp TSRMLS_CC); - object_init_ex(return_value, buttonrecord_class_entry_ptr); - add_property_resource(return_value, "buttonrecord", ret); - zend_list_addref(ret); -@@ -1384,7 +1384,7 @@ PHP_METHOD(swfbutton, addSound) - - if(item != NULL) { - /* try and create a soundinstance object */ -- ret = zend_list_insert(item, le_swfsoundinstancep); -+ ret = zend_list_insert(item, le_swfsoundinstancep TSRMLS_CC); - object_init_ex(return_value, soundinstance_class_entry_ptr); - add_property_resource(return_value, "soundinstance", ret); - zend_list_addref(ret); -@@ -1971,7 +1971,7 @@ PHP_METHOD(swfdisplayitem, getMatrix) - m = SWFDisplayItem_getMatrix(getDisplayItem(getThis() TSRMLS_CC)); - if(m != NULL) - { -- ret = zend_list_insert(m, le_swfmatrixp); -+ ret = zend_list_insert(m, le_swfmatrixp TSRMLS_CC); - object_init_ex(return_value, matrix_class_entry_ptr); - add_property_resource(return_value, "matrix", ret); - zend_list_addref(ret); -@@ -1992,7 +1992,7 @@ PHP_METHOD(swfdisplayitem, getCharacter) - c = SWFDisplayItem_getCharacter(getDisplayItem(getThis() TSRMLS_CC)); - if(c != NULL) - { -- ret = zend_list_insert(c, le_swfcharacterp); -+ ret = zend_list_insert(c, le_swfcharacterp TSRMLS_CC); - object_init_ex(return_value, character_class_entry_ptr); - add_property_resource(return_value, "character", ret); - zend_list_addref(ret); -@@ -2366,7 +2366,7 @@ PHP_METHOD(swffont, __construct) - - if(font) - { -- ret = zend_list_insert(font, le_swffontp); -+ ret = zend_list_insert(font, le_swffontp TSRMLS_CC); - object_init_ex(getThis(), font_class_entry_ptr); - add_property_resource(getThis(), "font", ret); - zend_list_addref(ret); -@@ -2537,7 +2537,7 @@ PHP_METHOD(swffiltermatrix, __construct) - - matrix = newSWFFilterMatrix(cols, rows, values); - free(values); /* array is copied by libming */ -- ret = zend_list_insert(matrix, le_swffiltermatrixp); -+ ret = zend_list_insert(matrix, le_swffiltermatrixp TSRMLS_CC); - object_init_ex(getThis(), filtermatrix_class_entry_ptr); - add_property_resource(getThis(), "filtermatrix", ret); - zend_list_addref(ret); -@@ -2582,7 +2582,7 @@ PHP_METHOD(swfshadow, __construct) - } - - shadow = newSWFShadow(angle, distance, strength); -- ret = zend_list_insert(shadow, le_swfshadowp); -+ ret = zend_list_insert(shadow, le_swfshadowp TSRMLS_CC); - object_init_ex(getThis(), shadow_class_entry_ptr); - add_property_resource(getThis(), "shadow", ret); - zend_list_addref(ret); -@@ -2628,7 +2628,7 @@ PHP_METHOD(swfblur, __construct) - } - - blur = newSWFBlur(blurX, blurY, passes); -- ret = zend_list_insert(blur, le_swfblurp); -+ ret = zend_list_insert(blur, le_swfblurp TSRMLS_CC); - object_init_ex(getThis(), blur_class_entry_ptr); - add_property_resource(getThis(), "blur", ret); - zend_list_addref(ret); -@@ -2665,7 +2665,7 @@ static zend_function_entry swfblur_funct - PHP_METHOD(swfgradient, __construct) - { - SWFGradient gradient = newSWFGradient(); -- int ret = zend_list_insert(gradient, le_swfgradientp); -+ int ret = zend_list_insert(gradient, le_swfgradientp TSRMLS_CC); - - object_init_ex(getThis(), gradient_class_entry_ptr); - add_property_resource(getThis(), "gradient", ret); -@@ -3076,7 +3076,7 @@ PHP_METHOD(swffilter, __construct) - if(filter == NULL) - WRONG_PARAM_COUNT; - -- ret = zend_list_insert(filter, le_swffilterp); -+ ret = zend_list_insert(filter, le_swffilterp TSRMLS_CC); - object_init_ex(getThis(), filter_class_entry_ptr); - add_property_resource(getThis(), "filter", ret); - zend_list_addref(ret); -@@ -3115,7 +3115,7 @@ static zend_function_entry swffilter_fun - PHP_METHOD(swfmorph, __construct) - { - SWFMorph morph = newSWFMorphShape(); -- int ret = zend_list_insert(morph, le_swfmorphp); -+ int ret = zend_list_insert(morph, le_swfmorphp TSRMLS_CC); - - object_init_ex(getThis(), morph_class_entry_ptr); - add_property_resource(getThis(), "morph", ret); -@@ -3147,7 +3147,7 @@ PHP_METHOD(swfmorph, getShape1) - { - SWFMorph morph = getMorph(getThis() TSRMLS_CC); - SWFShape shape = SWFMorph_getShape1(morph); -- int ret = zend_list_insert(shape, le_swfshapep); -+ int ret = zend_list_insert(shape, le_swfshapep TSRMLS_CC); - - object_init_ex(return_value, shape_class_entry_ptr); - add_property_resource(return_value, "shape", ret); -@@ -3161,7 +3161,7 @@ PHP_METHOD(swfmorph, getShape2) - { - SWFMorph morph = getMorph(getThis() TSRMLS_CC); - SWFShape shape = SWFMorph_getShape2(morph); -- int ret = zend_list_insert(shape, le_swfshapep); -+ int ret = zend_list_insert(shape, le_swfshapep TSRMLS_CC); - - object_init_ex(return_value, shape_class_entry_ptr); - add_property_resource(return_value, "shape", ret); -@@ -3205,7 +3205,7 @@ PHP_METHOD(swfsoundstream, __construct) - input = newSWFInput_filename(Z_STRVAL_P(zfile)); - if(input == NULL) - php_error(E_ERROR, "opening sound file failed"); -- zend_list_addref(zend_list_insert(input, le_swfinputp)); -+ zend_list_addref(zend_list_insert(input, le_swfinputp TSRMLS_CC)); - break; - - default: -@@ -3216,7 +3216,7 @@ PHP_METHOD(swfsoundstream, __construct) - sound = newSWFSoundStream_fromInput(input); - - if(sound) { -- ret = zend_list_insert(sound, le_swfsoundstreamp); -+ ret = zend_list_insert(sound, le_swfsoundstreamp TSRMLS_CC); - object_init_ex(getThis(), soundstream_class_entry_ptr); - add_property_resource(getThis(), "soundstream", ret); - zend_list_addref(ret); -@@ -3331,7 +3331,7 @@ PHP_METHOD(swfsound, __construct) - input = newSWFInput_filename(Z_STRVAL_P(zfile)); - if(input == NULL) - php_error(E_ERROR, "opening sound file failed"); -- zend_list_addref(zend_list_insert(input, le_swfinputp)); -+ zend_list_addref(zend_list_insert(input, le_swfinputp TSRMLS_CC)); - break; - - default: -@@ -3343,7 +3343,7 @@ PHP_METHOD(swfsound, __construct) - - if(sound != NULL) - { -- ret = zend_list_insert(sound, le_swfsoundp); -+ ret = zend_list_insert(sound, le_swfsoundp TSRMLS_CC); - object_init_ex(getThis(), sound_class_entry_ptr); - add_property_resource(getThis(), "sound", ret); - zend_list_addref(ret); -@@ -3479,7 +3479,7 @@ PHP_METHOD(swfvideostream, __construct) - input = newSWFInput_filename(Z_STRVAL_P(zfile)); - if(input == NULL) - php_error(E_ERROR, "opening sound video failed"); -- zend_list_addref(zend_list_insert(input, le_swfinputp)); -+ zend_list_addref(zend_list_insert(input, le_swfinputp TSRMLS_CC)); - break; - - default: -@@ -3496,7 +3496,7 @@ PHP_METHOD(swfvideostream, __construct) - } - - if(stream) { -- ret = zend_list_insert(stream, le_swfvideostreamp); -+ ret = zend_list_insert(stream, le_swfvideostreamp TSRMLS_CC); - object_init_ex(getThis(), videostream_class_entry_ptr); - add_property_resource(getThis(), "videostream", ret); - zend_list_addref(ret); -@@ -3646,7 +3646,7 @@ PHP_METHOD(swfbinarydata, __construct) - bd = newSWFBinaryData((unsigned char *)data, data_len); - - if(bd) { -- ret = zend_list_insert(bd, le_swfbinarydatap); -+ ret = zend_list_insert(bd, le_swfbinarydatap TSRMLS_CC); - object_init_ex(getThis(), binarydata_class_entry_ptr); - add_property_resource(getThis(), "binarydata", ret); - zend_list_addref(ret); -@@ -3704,7 +3704,7 @@ PHP_METHOD(swfprebuiltclip, __construct) - input = newSWFInput_filename(Z_STRVAL_P(zfile)); - if(input == NULL) - php_error(E_ERROR, "opening prebuilt clip file failed"); -- zend_list_addref(zend_list_insert(input, le_swfinputp)); -+ zend_list_addref(zend_list_insert(input, le_swfinputp TSRMLS_CC)); - break; - - default: -@@ -3715,7 +3715,7 @@ PHP_METHOD(swfprebuiltclip, __construct) - clip = newSWFPrebuiltClip_fromInput(input); - - if(clip) { -- ret = zend_list_insert(clip, le_swfprebuiltclipp); -+ ret = zend_list_insert(clip, le_swfprebuiltclipp TSRMLS_CC); - object_init_ex(getThis(), prebuiltclip_class_entry_ptr); - add_property_resource(getThis(), "prebuiltclip", ret); - zend_list_addref(ret); -@@ -3768,7 +3768,7 @@ PHP_METHOD(swfmovie, __construct) - movie = newSWFMovie(); /* default version 4 */ - } - -- ret = zend_list_insert(movie, le_swfmoviep); -+ ret = zend_list_insert(movie, le_swfmoviep TSRMLS_CC); - - object_init_ex(getThis(), movie_class_entry_ptr); - add_property_resource(getThis(), "movie", ret); -@@ -3880,7 +3880,7 @@ PHP_METHOD(swfmovie, add) - item = SWFMovie_add_internal(movie, ublock); - if (item != NULL) { - /* try and create a displayitem object */ -- ret = zend_list_insert(item, le_swfdisplayitemp); -+ ret = zend_list_insert(item, le_swfdisplayitemp TSRMLS_CC); - object_init_ex(return_value, displayitem_class_entry_ptr); - add_property_resource(return_value, "displayitem", ret); - zend_list_addref(ret); -@@ -4242,7 +4242,7 @@ PHP_METHOD(swfmovie, streamMP3) - php_error(E_ERROR, "opening mp3 file failed"); - } - -- zend_list_addref(zend_list_insert(input, le_swfinputp)); -+ zend_list_addref(zend_list_insert(input, le_swfinputp TSRMLS_CC)); - break; - - default: -@@ -4327,7 +4327,7 @@ PHP_METHOD(swfmovie, startSound) - if(item != NULL) - { - /* try and create a soundinstance object */ -- ret = zend_list_insert(item, le_swfsoundinstancep); -+ ret = zend_list_insert(item, le_swfsoundinstancep TSRMLS_CC); - object_init_ex(return_value, soundinstance_class_entry_ptr); - add_property_resource(return_value, "soundinstance", ret); - zend_list_addref(ret); -@@ -4369,7 +4369,7 @@ PHP_METHOD(swfmovie, importChar) - character = SWFMovie_importCharacter(movie, libswf, name); - if(character != NULL) - { -- ret = zend_list_insert(character, le_swfcharacterp); -+ ret = zend_list_insert(character, le_swfcharacterp TSRMLS_CC); - object_init_ex(return_value, character_class_entry_ptr); - add_property_resource(return_value, "character", ret); - zend_list_addref(ret); -@@ -4397,7 +4397,7 @@ PHP_METHOD(swfmovie, importFont) - if(res != NULL) - { - /* try and create a fontchar object */ -- ret = zend_list_insert(res, le_swffontcharp); -+ ret = zend_list_insert(res, le_swffontcharp TSRMLS_CC); - object_init_ex(return_value, fontchar_class_entry_ptr); - add_property_resource(return_value, "fontcharacter", ret); - zend_list_addref(ret); -@@ -4424,7 +4424,7 @@ PHP_METHOD(swfmovie, addFont) - if(res != NULL) - { - /* try and create a fontchar object */ -- ret = zend_list_insert(res, le_swffontcharp); -+ ret = zend_list_insert(res, le_swffontcharp TSRMLS_CC); - object_init_ex(return_value, fontchar_class_entry_ptr); - add_property_resource(return_value, "fontcharacter", ret); - zend_list_addref(ret); -@@ -4509,7 +4509,7 @@ static zend_function_entry swfmovie_func - PHP_METHOD(swfshape, __construct) - { - SWFShape shape = newSWFShape(); -- int ret = zend_list_insert(shape, le_swfshapep); -+ int ret = zend_list_insert(shape, le_swfshapep TSRMLS_CC); - - object_init_ex(getThis(), shape_class_entry_ptr); - add_property_resource(getThis(), "shape", ret); -@@ -4575,7 +4575,7 @@ PHP_METHOD(swfshape, addSolidFill) - } - - /* return an SWFFill object */ -- ret = zend_list_insert(fill, le_swffillp); -+ ret = zend_list_insert(fill, le_swffillp TSRMLS_CC); - object_init_ex(return_value, fill_class_entry_ptr); - add_property_resource(return_value, "fill", ret); - zend_list_addref(ret); -@@ -4618,7 +4618,7 @@ PHP_METHOD(swfshape, addBitmapFill) - } - - /* return an SWFFill object */ -- ret = zend_list_insert(fill, le_swffillp); -+ ret = zend_list_insert(fill, le_swffillp TSRMLS_CC); - object_init_ex(return_value, fill_class_entry_ptr); - add_property_resource(return_value, "fill", ret); - zend_list_addref(ret); -@@ -4664,7 +4664,7 @@ PHP_METHOD(swfshape, addGradientFill) - } - - /* return an SWFFill object */ -- ret = zend_list_insert(fill, le_swffillp); -+ ret = zend_list_insert(fill, le_swffillp TSRMLS_CC); - object_init_ex(return_value, fill_class_entry_ptr); - add_property_resource(return_value, "fill", ret); - zend_list_addref(ret); -@@ -4719,7 +4719,7 @@ PHP_METHOD(swfshape, addFill) - } - - /* return an SWFFill object */ -- ret = zend_list_insert(fill, le_swffillp); -+ ret = zend_list_insert(fill, le_swffillp TSRMLS_CC); - object_init_ex(return_value, fill_class_entry_ptr); - add_property_resource(return_value, "fill", ret); - zend_list_addref(ret); -@@ -5209,7 +5209,7 @@ static zend_function_entry swfshape_func - PHP_METHOD(swfsprite, __construct) - { - SWFMovieClip sprite = newSWFMovieClip(); -- int ret = zend_list_insert(sprite, le_swfspritep); -+ int ret = zend_list_insert(sprite, le_swfspritep TSRMLS_CC); - - object_init_ex(getThis(), sprite_class_entry_ptr); - add_property_resource(getThis(), "sprite", ret); -@@ -5259,7 +5259,7 @@ PHP_METHOD(swfsprite, add) - - if (item != NULL) { - /* try and create a displayitem object */ -- ret = zend_list_insert(item, le_swfdisplayitemp); -+ ret = zend_list_insert(item, le_swfdisplayitemp TSRMLS_CC); - object_init_ex(return_value, displayitem_class_entry_ptr); - add_property_resource(return_value, "displayitem", ret); - zend_list_addref(ret); -@@ -5342,7 +5342,7 @@ PHP_METHOD(swfsprite, startSound) - - if(item != NULL) { - /* try and create a displayitem object */ -- ret = zend_list_insert(item, le_swfsoundinstancep); -+ ret = zend_list_insert(item, le_swfsoundinstancep TSRMLS_CC); - object_init_ex(return_value, soundinstance_class_entry_ptr); - add_property_resource(return_value, "soundinstance", ret); - zend_list_addref(ret); -@@ -5400,7 +5400,7 @@ PHP_METHOD(swfsprite, setSoundStream) - input = newSWFInput_filename(Z_STRVAL_P(zfile)); - if(input == NULL) - php_error(E_ERROR, "opening sound file failed"); -- zend_list_addref(zend_list_insert(input, le_swfinputp)); -+ zend_list_addref(zend_list_insert(input, le_swfinputp TSRMLS_CC)); - break; - - } -@@ -5521,7 +5521,7 @@ PHP_METHOD(swftext, __construct) - text = newSWFText2(); - } - -- int ret = zend_list_insert(text, le_swftextp); -+ int ret = zend_list_insert(text, le_swftextp TSRMLS_CC); - object_init_ex(getThis(), text_class_entry_ptr); - add_property_resource(getThis(), "text", ret); - zend_list_addref(ret); -@@ -5794,7 +5794,7 @@ PHP_METHOD(swftextfield, __construct) - { - long flags = 0; - SWFTextField field = newSWFTextField(); -- int ret = zend_list_insert(field, le_swftextfieldp); -+ int ret = zend_list_insert(field, le_swftextfieldp TSRMLS_CC); - - object_init_ex(getThis(), textfield_class_entry_ptr); - add_property_resource(getThis(), "textfield", ret); diff --git a/multimedia/ming/patches/patch-src_blocks_gifdbl.c b/multimedia/ming/patches/patch-src_blocks_gifdbl.c deleted file mode 100644 index 8d6a3e265826..000000000000 --- a/multimedia/ming/patches/patch-src_blocks_gifdbl.c +++ /dev/null @@ -1,45 +0,0 @@ -$NetBSD: patch-src_blocks_gifdbl.c,v 1.3 2014/05/16 10:00:33 obache Exp $ - -* Fix build with giflib>=5.0. - ---- src/blocks/gifdbl.c.orig 2010-10-10 07:19:23.000000000 +0000 -+++ src/blocks/gifdbl.c -@@ -203,7 +203,13 @@ readGif(GifFileType *file, dblData resul - } - - /* Done! */ -- DGifCloseFile(file); -+#if (GIFLIB_MAJOR + 0) >= 5 && (GIFLIB_MINOR + 0 >= 1) || (GIFLIB_MAJOR + 0 ) > 5 -+ DGifCloseFile(file, NULL); -+#else -+ if (DGifCloseFile(file) != GIF_OK) { -+ free(file); -+ } -+#endif - - result->data = malloc(outsize = (int)floor(size*1.01+12)); - -@@ -227,7 +233,11 @@ SWFDBLBitmapData newSWFDBLBitmapData_fro - SWFDBLBitmapData ret; - struct dbl_data gifdata; - -+#if (GIFLIB_MAJOR + 0) >= 5 -+ if((file = DGifOpenFileName(fileName, NULL)) == NULL) -+#else - if((file = DGifOpenFileName(fileName)) == NULL) -+#endif - return NULL; - if(!readGif(file, &gifdata)) - return NULL; -@@ -246,7 +256,11 @@ SWFDBLBitmapData newSWFDBLBitmapData_fro - SWFDBLBitmapData ret; - struct dbl_data gifdata; - -+#if (GIFLIB_MAJOR + 0) >= 5 -+ if((file = DGifOpen(input, (InputFunc) gifReadFunc, NULL)) == NULL) -+#else - if((file = DGifOpen(input, (InputFunc) gifReadFunc)) == NULL) -+#endif - return NULL; - if(!readGif(file, &gifdata)) - return NULL; diff --git a/multimedia/ming/patches/patch-src_libming.h b/multimedia/ming/patches/patch-src_libming.h deleted file mode 100644 index 4ef23b471db0..000000000000 --- a/multimedia/ming/patches/patch-src_libming.h +++ /dev/null @@ -1,41 +0,0 @@ -$NetBSD: patch-src_libming.h,v 1.3 2014/05/16 10:00:33 obache Exp $ - -* Introduce custom PrintGifError() from util/qprintf.c of giflib>=5. - ---- src/libming.h.orig 2013-06-08 14:08:51.000000000 +0000 -+++ src/libming.h -@@ -31,6 +31,7 @@ - - #include - #include -+#include - - - #include "ming.h" -@@ -78,9 +79,26 @@ typedef unsigned char BOOL; - - #if GIFLIB_GIFERRORSTRING - static void -+#if (GIFLIB_MAJOR + 0) >= 5 -+PrintGifError(int ErrorCode) -+#else - PrintGifError(void) -+#endif - { -+#if (GIFLIB_MAJOR + 0) >= 5 -+# if GIFLIB_MAJOR == 5 && GIFLIB_MINOR == 0 -+ char *Err = GifErrorString(ErrorCode); -+# else -+ const char *Err = GifErrorString(ErrorCode); -+# endif -+ -+ if (Err != NULL) -+ fprintf(stderr, "\nGIF-LIB error: %s.\n", Err); -+ else -+ fprintf(stderr, "\nGIF-LIB undefined error %d.\n", ErrorCode); -+#else - fprintf(stderr, "\nGIF-LIB error: %s.\n", GifErrorString()); -+#endif - } - #endif - diff --git a/multimedia/ming/patches/patch-util_gif2dbl.c b/multimedia/ming/patches/patch-util_gif2dbl.c deleted file mode 100644 index e9b40e4cd805..000000000000 --- a/multimedia/ming/patches/patch-util_gif2dbl.c +++ /dev/null @@ -1,64 +0,0 @@ -$NetBSD: patch-util_gif2dbl.c,v 1.3 2014/05/16 10:00:33 obache Exp $ - -* Fix build with giflib 5.0.4. -* Catch error with gifib 5.0 manner. - ---- util/gif2dbl.c.orig 2013-06-08 14:08:51.000000000 +0000 -+++ util/gif2dbl.c -@@ -19,10 +19,18 @@ - - #include "libming.h" - -+#if (GIFLIB_MAJOR + 0) >= 5 -+void error(char *msg, int ErrorCode) -+#else - void error(char *msg) -+#endif - { - printf("%s:\n\n", msg); -+#if (GIFLIB_MAJOR + 0) >= 5 -+ PrintGifError(ErrorCode); -+#else - PrintGifError(); -+#endif - exit(-1); - } - -@@ -58,12 +66,22 @@ unsigned char *readGif(char *fileName, i - unsigned char *data; - unsigned char *p; - int i, nColors, size, alpha, bgColor, alignedWidth; -+#if (GIFLIB_MAJOR + 0) >= 5 -+ int ErrorCode; - -+ if((file = DGifOpenFileName(fileName, &ErrorCode)) == NULL) -+ error("Error opening file", ErrorCode); -+#else - if((file = DGifOpenFileName(fileName)) == NULL) - error("Error opening file"); -+#endif - - if(DGifSlurp(file) != GIF_OK) -+#if (GIFLIB_MAJOR + 0) >= 5 -+ error("Error slurping file", file->Error); -+#else - error("Error slurping file"); -+#endif - - /* data should now be available */ - -@@ -190,7 +208,13 @@ unsigned char *readGif(char *fileName, i - } - - /* Done! */ -- DGifCloseFile(file); -+#if (GIFLIB_MAJOR + 0) >= 5 && (GIFLIB_MINOR >= 1) || (GIFLIB_MAJOR + 0) > 5 -+ DGifCloseFile(file, NULL); -+#else -+ if (DGifCloseFile(file) != GIF_OK) { -+ free(file); -+ } -+#endif - - *length = size; - return data; diff --git a/multimedia/ming/patches/patch-util_gif2mask.c b/multimedia/ming/patches/patch-util_gif2mask.c deleted file mode 100644 index 1c27c63c4dde..000000000000 --- a/multimedia/ming/patches/patch-util_gif2mask.c +++ /dev/null @@ -1,49 +0,0 @@ -$NetBSD: patch-util_gif2mask.c,v 1.2 2014/05/16 10:00:33 obache Exp $ - -* Fix build with giflib 5.0.4. -* Catch error with gifib 5.0 manner. - ---- util/gif2mask.c.orig 2013-06-08 14:08:51.000000000 +0000 -+++ util/gif2mask.c -@@ -13,10 +13,18 @@ - - #define max(a,b,c) (((a)>(b))?(((c)>(a))?(c):(a)):(((c)>(b))?(c):(b))) - -+#if (GIFLIB_MAJOR + 0) >= 5 -+void error(char *msg, int ErrorCode) -+#else - void error(char *msg) -+#endif - { - printf("%s:\n\n", msg); -+#if (GIFLIB_MAJOR + 0) >= 5 -+ PrintGifError(ErrorCode); -+#else - PrintGifError(); -+#endif - exit(-1); - } - -@@ -27,12 +35,22 @@ unsigned char *readGif(char *fileName, i - unsigned char colorMap[256]; - unsigned char *data; - int i, nColors, size; -+#if (GIFLIB_MAJOR + 0) >= 5 -+ int ErrorCode; - -+ if((file = DGifOpenFileName(fileName, &ErrorCode)) == NULL) -+ error("Error opening file", ErrorCode); -+#else - if((file = DGifOpenFileName(fileName)) == NULL) - error("Error opening file"); -+#endif - - if(DGifSlurp(file) != GIF_OK) -+#if (GIFLIB_MAJOR + 0) >= 5 -+ error("Error slurping file", file->Error); -+#else - error("Error slurping file"); -+#endif - - /* data should now be available */ -