Date: Saturday, September 12, 2020 @ 02:29:08
  Author: cbehan
Revision: 703086

upgpkg: ming 0.4.8.r68.g04aee523-1: Update to 0.4.8

Added:
  ming/trunk/py3.patch
Modified:
  ming/trunk/PKGBUILD
Deleted:
  ming/trunk/pull-145.patch
  ming/trunk/pull-179.patch
  ming/trunk/python3.patch

----------------+
 PKGBUILD       |   17 --
 pull-145.patch |  389 -------------------------------------------------------
 pull-179.patch |   81 -----------
 py3.patch      |  207 +++++++++++++++++++++++++++++
 python3.patch  |  102 --------------
 5 files changed, 214 insertions(+), 582 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD    2020-09-12 02:28:29 UTC (rev 703085)
+++ PKGBUILD    2020-09-12 02:29:08 UTC (rev 703086)
@@ -2,7 +2,7 @@
 # Contributor: mar77i <mysatyre at gmail dot com>
 
 pkgname=ming
-pkgver=r3160.50098023
+pkgver=0.4.8.r68.g04aee523
 pkgrel=1
 pkgdesc="SWF output library"
 arch=('x86_64')
@@ -9,24 +9,21 @@
 url="http://www.libming.net/";
 license=('GPL' 'LGPL')
 depends=('freetype2' 'libpng' 'flex' 'giflib')
-makedepends=('bison' 'pkgconf' 'python' 'git')
+makedepends=('bison' 'pkgconf' 'swig' 'python' 'git')
 options=('!emptydirs')
-source=(git+https://github.com/libming/libming.git python3.patch 
pull-145.patch pull-179.patch)
+source=(git+https://github.com/libming/libming.git#commit=04aee52363688426eab74f5d6180c149654a6473
 py3.patch)
 sha256sums=('SKIP'
-            '7794e62df85c94d1ab1e9de0fc11222f52b9920a4babed4a74906f6ed1bcfb1d'
-            '863be1aadbd12d957b39e731ab4b7d7c18f5d5fe38b993020f86c4e7123072ff'
-            '5e8281464ba030d228d3c6a1c45c6b7ca2a4a6c698f03022a4c66999458d8d63')
+            'c33000d71c4e7308c6c4b7a3be05087d6b088b86caa841d0e11585c26cbc1e64')
 
 pkgver() {
   cd "$srcdir"/libming
-  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short 
HEAD)"
+  git describe --long | sed 's/^ming-//;s/\([^-]*-g\)/r\1/;s/[-_]/./g'
 }
 
 build() {
   cd "$srcdir"/libming
-  git apply ../pull-145.patch
-  git apply ../pull-179.patch
-  git apply ../python3.patch
+  export CFLAGS="$CFLAGS -fcommon"
+  git apply ../py3.patch
 
   ./autogen.sh
   PYTHON=/usr/bin/python ./configure --prefix=/usr --enable-python

Deleted: pull-145.patch
===================================================================
--- pull-145.patch      2020-09-12 02:28:29 UTC (rev 703085)
+++ pull-145.patch      2020-09-12 02:29:08 UTC (rev 703086)
@@ -1,389 +0,0 @@
-From d13db01ea1c416f51043bef7496cfb25c2dde29a Mon Sep 17 00:00:00 2001
-From: Hugo Lefeuvre <[email protected]>
-Date: Fri, 25 May 2018 22:11:51 -0400
-Subject: [PATCH 1/7] decompile: Fix null pointer dereference in getInt
-
-When getInt is passed a PUSH_REGISTER parameter, it retrieves the
-content of this register and returns the value contained by this
-register as an int. When this register is empty, we call getInt with
-a NULL pointer and a null pointer dereference occurs.
-
-In this patch we first make sure that regs[act->p.RegisterNumber] is
-not NULL before doing anything with it.
-
-Fixes #133 (CVE-2018-9132).
----
- NEWS             |  1 +
- util/decompile.c | 10 +++++++++-
- 2 files changed, 10 insertions(+), 1 deletion(-)
-
-diff --git a/NEWS b/NEWS
-index 129d55fe..609d6d05 100644
---- a/NEWS
-+++ b/NEWS
-@@ -43,6 +43,7 @@
-     with empty acts (NULL act->p.String). Perform deep copy in pushdup,
-     instead of shallow copy (issue #121).
-   * Fix heap-buffer-overflow in getString (CVE-2018-7867, issue #116).
-+  * Fix null pointer dereference in getInt (CVE-2018-9132, issue #133).
- 
- 0.4.8 - 2017-04-07
- 
-diff --git a/util/decompile.c b/util/decompile.c
-index e9341356..28aa0bf6 100644
---- a/util/decompile.c
-+++ b/util/decompile.c
-@@ -481,7 +481,15 @@ getInt(struct SWF_ACTIONPUSHPARAM *act)
-       case PUSH_NULL: /* NULL */
-               return 0;
-       case PUSH_REGISTER: /* REGISTER */
--              return getInt(regs[act->p.RegisterNumber]);
-+              if (regs[act->p.RegisterNumber])
-+              {
-+                      return getInt(regs[act->p.RegisterNumber]);
-+              }
-+              else
-+              {
-+                      SWF_warn("WARNING: retrieving undefined register 
values.\n");
-+                      break;
-+              }
-       case PUSH_DOUBLE: /* DOUBLE */
-               return (int)act->p.Double;
-       case PUSH_INT: /* INTEGER */
-
-From 835cdd0776456483466c6d640d251548e7d9dcdb Mon Sep 17 00:00:00 2001
-From: Hugo Lefeuvre <[email protected]>
-Date: Fri, 25 May 2018 22:22:33 -0400
-Subject: [PATCH 2/7] decompile: fix use-after-free in decompileJUMP
-
-Same issue as f42fdb4 (functions accessing actions array without
-checking the validity of n, the user entered index), same fix.
-
-In this patch we also fix other source code places which might be
-affected by the same bug.
-
-Fixes #131 (CVE-2018-9009).
----
- NEWS             | 1 +
- util/decompile.c | 8 ++++----
- 2 files changed, 5 insertions(+), 4 deletions(-)
-
-diff --git a/NEWS b/NEWS
-index 609d6d05..a1464d03 100644
---- a/NEWS
-+++ b/NEWS
-@@ -44,6 +44,7 @@
-     instead of shallow copy (issue #121).
-   * Fix heap-buffer-overflow in getString (CVE-2018-7867, issue #116).
-   * Fix null pointer dereference in getInt (CVE-2018-9132, issue #133).
-+  * Fix heap-use-after-free in decompileJUMP (CVE-2018-9009, issue #131).
- 
- 0.4.8 - 2017-04-07
- 
-diff --git a/util/decompile.c b/util/decompile.c
-index 28aa0bf6..72a51618 100644
---- a/util/decompile.c
-+++ b/util/decompile.c
-@@ -1937,7 +1937,7 @@ decompileJUMP(int n, SWF_ACTION *actions, int maxn)
-                       {
-                               sactif = (struct SWF_ACTIONIF 
*)&(actions[n+i+j]);
-                               /* chk whether last jump does lead us back to 
start of loop */
--                              if 
(sactif->Actions[sactif->numActions-1].SWF_ACTIONRECORD.ActionCode==SWFACTION_JUMP
-+                              if (OpCode(sactif->Actions, 
sactif->numActions-1, maxn) == SWFACTION_JUMP
-                                   && 
sactif->Actions[sactif->numActions-1].SWF_ACTIONJUMP.BranchOffset+
-                                   
sactif->Actions[sactif->numActions-1].SWF_ACTIONJUMP.Offset==
-                                   actions[n].SWF_ACTIONRECORD.Offset )
-@@ -2342,7 +2342,7 @@ decompileIF(int n, SWF_ACTION *actions, int maxn)
-        * that points to a JUMP above the IF statement.
-        */
-       if(n && isLogicalOp(n-1, actions, maxn) &&
--         (sact->Actions[sact->numActions-1].SWF_ACTIONRECORD.ActionCode == 
SWFACTION_JUMP) &&
-+         (OpCode(sact->Actions, sact->numActions-1, maxn) == SWFACTION_JUMP) 
&&
-          ( (sact->Actions[sact->numActions-1].SWF_ACTIONJUMP.Offset +
-             sact->Actions[sact->numActions-1].SWF_ACTIONJUMP.BranchOffset) < 
actions[n].SWF_ACTIONRECORD.Offset) &&
-             isLogicalOp(sact->numActions-2, sact->Actions, maxn) ) 
-@@ -2432,7 +2432,7 @@ decompileIF(int n, SWF_ACTION *actions, int maxn)
-        */
-       
-       if( isLogicalOp(n-1, actions, maxn) &&
--          ( (sact->Actions[sact->numActions-1].SWF_ACTIONRECORD.ActionCode == 
SWFACTION_JUMP) &&
-+          ((OpCode(sact->Actions, sact->numActions-1, maxn) == 
SWFACTION_JUMP) &&
-              sact->Actions[sact->numActions-1].SWF_ACTIONJUMP.BranchOffset < 
0) ) 
-       {
-               if(0)       dumpRegs();
-@@ -2468,7 +2468,7 @@ decompileIF(int n, SWF_ACTION *actions, int maxn)
-       }
-       { // WTF ???
- #define SOME_IF_DEBUG 0       /* coders only */
--              int has_else_or_break= 
((sact->Actions[sact->numActions-1].SWF_ACTIONRECORD.ActionCode == 
SWFACTION_JUMP) &&
-+              int has_else_or_break= ((OpCode(sact->Actions, 
sact->numActions-1, maxn) == SWFACTION_JUMP) &&
-                       
(sact->Actions[sact->numActions-1].SWF_ACTIONJUMP.BranchOffset > 0 )) ? 1:0;
-               int has_lognot=(OpCode(actions, n-1, maxn) == 
SWFACTION_LOGICALNOT) ? 1:0;
-               int else_action_cnt=0,is_logor=0,is_logand=0,sbi,sbe;
-
-From 60c8371a4275f986080eec86e8f0076f31539ee6 Mon Sep 17 00:00:00 2001
-From: Hugo Lefeuvre <[email protected]>
-Date: Fri, 25 May 2018 22:28:18 -0400
-Subject: [PATCH 3/7] swftypes: fix type issue causing memory exhaustion
-
-This commit fixes the memory exhaustion issue in
-parseSWF_ACTIONRECORD (fixes: #109, CVE-2018-7876).
-
-The original issue consists is triggered by an integer overflow in
-parseSWF_ACTIONRECORD, where we read a UI16 and store it in a WORD,
-which is defined as SI16. This is because type WORD (=SI16) is used
-for NumParam (in SWF_ACTIONDEFINEFUNCTION), while the specification
-says it should be UI16 (page 92 of the spec).
-
-This patch addresses this type issue by changing type of NumParam
-from WORD to UI16.
----
- NEWS            | 1 +
- util/swftypes.h | 2 +-
- 2 files changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/NEWS b/NEWS
-index a1464d03..0a946b00 100644
---- a/NEWS
-+++ b/NEWS
-@@ -45,6 +45,7 @@
-   * Fix heap-buffer-overflow in getString (CVE-2018-7867, issue #116).
-   * Fix null pointer dereference in getInt (CVE-2018-9132, issue #133).
-   * Fix heap-use-after-free in decompileJUMP (CVE-2018-9009, issue #131).
-+  * Fix memory exhaustion in parseSWF_ACTIONRECORD (CVE-2018-7876, #109).
- 
- 0.4.8 - 2017-04-07
- 
-diff --git a/util/swftypes.h b/util/swftypes.h
-index fe80eb2c..9648c628 100644
---- a/util/swftypes.h
-+++ b/util/swftypes.h
-@@ -363,7 +363,7 @@ struct SWF_ACTIONDEFINEFUNCTION {
-       UI16    Length;
-       UI32    Offset;
-       STRING  FunctionName;
--      WORD    NumParams;
-+      UI16    NumParams;
-       STRING  *Params;
-       WORD    CodeSize;
-       int     numActions;
-
-From 6631f9b7927868ed13f870e153ff71013add0554 Mon Sep 17 00:00:00 2001
-From: Hugo Lefeuvre <[email protected]>
-Date: Fri, 25 May 2018 22:39:12 -0400
-Subject: [PATCH 4/7] decompile: fix buffer-overflow in getString
-
-getString prints a 32 bit integer to a 10 char buffer, but the number
-itself has 10 digits so there's an overflow.
-
-Similar to #116, same fix.
-
-Fixes #111, CVE-2018-7873.
----
- NEWS             |  1 +
- util/decompile.c | 14 ++++++++++++--
- 2 files changed, 13 insertions(+), 2 deletions(-)
-
-diff --git a/NEWS b/NEWS
-index 0a946b00..a40acd69 100644
---- a/NEWS
-+++ b/NEWS
-@@ -46,6 +46,7 @@
-   * Fix null pointer dereference in getInt (CVE-2018-9132, issue #133).
-   * Fix heap-use-after-free in decompileJUMP (CVE-2018-9009, issue #131).
-   * Fix memory exhaustion in parseSWF_ACTIONRECORD (CVE-2018-7876, #109).
-+  * Fix heap-buffer-overflow in function getString (CVE-2018-7873, #111).
- 
- 0.4.8 - 2017-04-07
- 
-diff --git a/util/decompile.c b/util/decompile.c
-index 72a51618..61f53350 100644
---- a/util/decompile.c
-+++ b/util/decompile.c
-@@ -358,9 +358,19 @@ getString(struct SWF_ACTIONPUSHPARAM *act)
-               return t;
-       }
-       case PUSH_INT: /* INTEGER */
--              t=malloc(10); /* 32-bit decimal */
--              sprintf(t,"%ld", act->p.Integer );
-+      {
-+              char length_finder[1];
-+              int needed_length = snprintf(length_finder, 1, "%ld", 
act->p.Integer) + 1;
-+              if (needed_length <= 0)
-+              {
-+                      SWF_warn("WARNING: could not evaluate size of buffer 
(memory issue ?).\n");
-+                      break;
-+              }
-+
-+              t = malloc(needed_length);
-+              sprintf(t, "%ld", act->p.Integer );
-               return t;
-+      }
-       case PUSH_CONSTANT: /* CONSTANT8 */
-               if (act->p.Constant8 > poolcounter)
-               {
-
-From 2f8b17e6552f21eb7ff1265e1aa8897fd8a604f9 Mon Sep 17 00:00:00 2001
-From: Hugo Lefeuvre <[email protected]>
-Date: Fri, 25 May 2018 22:45:22 -0400
-Subject: [PATCH 5/7] decompile: fix null pointer dereference in newVar3
-
-getString (indirectly called by getName) is passed a variable of non
-standard type 10 (= "PUSH_VARIABLE"), which seems to return the
-string contained in passed variable, without quotes. If contained
-string is NULL, a NULL pointer is returned, which later causes NULL
-pointer dereference.
-
-In this patch we address this issue such that if the variable contains
-an invalid string, we act just like in the PUSH_STRING case. Otherwise
-a copy of the string is returned.
-
-Fixes: #118 (CVE-2018-7866).
----
- NEWS             | 1 +
- util/decompile.c | 9 ++++++++-
- 2 files changed, 9 insertions(+), 1 deletion(-)
-
-diff --git a/NEWS b/NEWS
-index a40acd69..7eb256ca 100644
---- a/NEWS
-+++ b/NEWS
-@@ -47,6 +47,7 @@
-   * Fix heap-use-after-free in decompileJUMP (CVE-2018-9009, issue #131).
-   * Fix memory exhaustion in parseSWF_ACTIONRECORD (CVE-2018-7876, #109).
-   * Fix heap-buffer-overflow in function getString (CVE-2018-7873, #111).
-+  * Fix null pointer dereference in newVar3 (CVE-2018-7866, #118).
- 
- 0.4.8 - 2017-04-07
- 
-diff --git a/util/decompile.c b/util/decompile.c
-index 61f53350..dee2ba0f 100644
---- a/util/decompile.c
-+++ b/util/decompile.c
-@@ -397,7 +397,14 @@ getString(struct SWF_ACTIONPUSHPARAM *act)
-       case 12:
-       case 11: /* INCREMENTED or DECREMENTED VARIABLE */
-       case PUSH_VARIABLE: /* VARIABLE */
--              return act->p.String;
-+              if (!act->p.String)
-+              {
-+                      SWF_warn("WARNING: Call to getString with PUSH_VARIABLE 
defining NULL string.\n");
-+                      break;
-+              }
-+              t=malloc(strlen(act->p.String)+1); /* NULL character */
-+              strcpy(t,act->p.String);
-+              return t;
-       default: 
-               fprintf (stderr,"  Can't get string for type: %d\n", act->Type);
-               break;
-
-From 86badaaa948e5d7d4db01c0404452bbafee30201 Mon Sep 17 00:00:00 2001
-From: Hugo Lefeuvre <[email protected]>
-Date: Sun, 10 Jun 2018 16:33:29 -0400
-Subject: [PATCH 6/7] decompile: introduce new method Offset
-
-The getString method in decompile.c is vulnerable to a buffer
-overflow which can be triggered using a crafted SWF file.
-
-This vulnerability is the consequence of unchecked accesses to the
-actions array when getting the offset of SWF_ACTIONRECORD objects.
-
-This pattern is present a bit everywhere in the source code, leading
-to a large number of potential flaws similar to this one. In this
-commit we introduce a new Offset method similar to the OpCode method
-which handles bound checking when retrieving the offset of
-SWF_ACTIONRECORD objects.
-
-This commit also modifies getString to use this newly introduced
-method and address the previously explained bug.
-
-Usage of the newly introduced Offset method will be generalized in a
-future commit.
-
-Please, note that this commit won't be sufficient to fix #144
-(CVE-2018-11226) since another issue is triggered by the same sample.
----
- util/decompile.c | 20 +++++++++++++++++++-
- 1 file changed, 19 insertions(+), 1 deletion(-)
-
-diff --git a/util/decompile.c b/util/decompile.c
-index dee2ba0f..e444e2f7 100644
---- a/util/decompile.c
-+++ b/util/decompile.c
-@@ -964,6 +964,24 @@ decompileGETURL2 (SWF_ACTION *act)
-       return 0;
- }
- 
-+static inline int Offset(SWF_ACTION *actions, int n, int maxn)
-+{
-+      if(!n || n >= maxn)
-+      {
-+#if DEBUG
-+              SWF_warn("Offset: want %i, max %i\n", n, maxn);
-+#endif
-+              return -999;
-+      } else if (n < 1) {
-+
-+#if DEBUG
-+              SWF_warn("Offset: want %i < 1\n", n);
-+#endif
-+              return -998;
-+      }
-+      return actions[n].SWF_ACTIONRECORD.Offset;
-+}
-+
- static inline int OpCode(SWF_ACTION *actions, int n, int maxn)
- {
-       if(!n || n >= maxn)
-@@ -2126,7 +2144,7 @@ decompile_SWITCH(int n, SWF_ACTION *actions, int maxn, 
int off1end)
-       int offSave;
-       for (i=0; i<n_firstactions; i++) // seek last op in 1st if
-       {
--              if (actions[i+1].SWF_ACTIONRECORD.Offset==off1end)
-+              if (Offset(actions, i+1, maxn) == off1end)
-               {
-                       // println("found #off end first= %d",i+1);
-                       if (OpCode(actions, i, maxn) == SWFACTION_JUMP)
-
-From 6c24ac45b8524516547d78a6fe463d4ff4b856ba Mon Sep 17 00:00:00 2001
-From: Hugo Lefeuvre <[email protected]>
-Date: Sat, 30 Jun 2018 14:15:08 -0400
-Subject: [PATCH 7/7] decompile: fix loop cond issue leading to OOB read
-
-In decompileSETTARGET a while loop is used to count the number of
-operations until a certain type of operation has been reached. This
-loop uses action_cnt+n < maxn as stop condition, meaning that
-action_cnt+n = maxn might be true after the loop.
-
-This is wrong because action_cnt is used as the number of operations
-to process in an array of maxn-n-1 elements.
-
-Fix the loop's stop condition and switch to for loop for better
-readability.
-
-This patch is the second part of the CVE-2018-11226 fix (fixes: #144).
----
- util/decompile.c | 3 +--
- 1 file changed, 1 insertion(+), 2 deletions(-)
-
-diff --git a/util/decompile.c b/util/decompile.c
-index e444e2f7..cf1a372d 100644
---- a/util/decompile.c
-+++ b/util/decompile.c
-@@ -3197,7 +3197,7 @@ decompileSETTARGET(int n, SWF_ACTION *actions, int maxn, 
int is_type2)
-       {
-               INDENT
-               println("tellTarget('%s') {" ,name);
--              while(action_cnt+n<maxn)
-+              for (; action_cnt+n < maxn-1; action_cnt++)
-               {
-                       if (OpCode(actions, n+1+action_cnt, 
maxn)==SWFACTION_SETTARGET
-                           || OpCode(actions, n+1+action_cnt, 
maxn)==SWFACTION_SETTARGET2
-@@ -3207,7 +3207,6 @@ decompileSETTARGET(int n, SWF_ACTION *actions, int maxn, 
int is_type2)
-                       {
-                               break;
-                       }
--                      action_cnt++;
-               }
-               decompileActions(action_cnt,&actions[n+1],gIndent+1);
-               INDENT

Deleted: pull-179.patch
===================================================================
--- pull-179.patch      2020-09-12 02:28:29 UTC (rev 703085)
+++ pull-179.patch      2020-09-12 02:29:08 UTC (rev 703086)
@@ -1,81 +0,0 @@
-From 3dc0338e4a36a3092720ebaa5b908ba3dca467d9 Mon Sep 17 00:00:00 2001
-From: Young Xiao <[email protected]>
-Date: Sat, 16 Mar 2019 17:27:18 +0800
-Subject: [PATCH 1/3] SWFShape_setLeftFillStyle: prevent fill overflow
-
----
- src/blocks/shape.c | 5 +++++
- 1 file changed, 5 insertions(+)
-
-diff --git a/src/blocks/shape.c b/src/blocks/shape.c
-index 67c81dcf..cfab7bca 100644
---- a/src/blocks/shape.c
-+++ b/src/blocks/shape.c
-@@ -1169,6 +1169,11 @@ SWFShape_setLeftFillStyle(SWFShape shape, SWFFillStyle 
fill)
-                       return;         
-               idx = getFillIdx(shape, fill);
-       }
-+      else if (idx >= 255 && shape->useVersion == SWF_SHAPE1)
-+      {
-+              SWF_error("Too many fills for SWFShape V1.\n" 
-+                        "Use a higher SWFShape version\n");
-+      }
-                               
-       record = addStyleRecord(shape);
-       record.record.stateChange->leftFill = idx;
-
-From 2be22fcf56a223dafe8de0e8a20fe20e8bbdb0b9 Mon Sep 17 00:00:00 2001
-From: Young Xiao <[email protected]>
-Date: Sat, 16 Mar 2019 17:42:14 +0800
-Subject: [PATCH 2/3] decompileAction: Prevent heap buffer overflow and
- underflow with using OpCode
-
----
- util/decompile.c | 3 +--
- 1 file changed, 1 insertion(+), 2 deletions(-)
-
-diff --git a/util/decompile.c b/util/decompile.c
-index e9341356..1df56da5 100644
---- a/util/decompile.c
-+++ b/util/decompile.c
-@@ -3202,7 +3202,6 @@ decompileCAST(int n, SWF_ACTION *actions, int maxn)
- int
- decompileAction(int n, SWF_ACTION *actions, int maxn)
- {
--      if( n > maxn ) SWF_error("Action overflow!!");
- 
- #ifdef DEBUG
-       fprintf(stderr,"%d:\tACTION[%3.3d]: %s\n",
-@@ -3210,7 +3209,7 @@ decompileAction(int n, SWF_ACTION *actions, int maxn)
-               actionName(actions[n].SWF_ACTIONRECORD.ActionCode));
- #endif
- 
--      switch(actions[n].SWF_ACTIONRECORD.ActionCode)
-+      switch(OpCode(actions, n, maxn))
-       {
-       case SWFACTION_END:
-               return 0;
-
-From 2223f7a1e431455a1411bee77c90db94a6f8e8fe Mon Sep 17 00:00:00 2001
-From: Young Xiao <[email protected]>
-Date: Sat, 16 Mar 2019 18:50:24 +0800
-Subject: [PATCH 3/3] Fix left shift of a negative value in SWFInput_readSBits.
- Check for number before before left-shifting by (number-1).
-
----
- src/blocks/input.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/blocks/input.c b/src/blocks/input.c
-index 478a0fe1..6e4a8320 100644
---- a/src/blocks/input.c
-+++ b/src/blocks/input.c
-@@ -113,7 +113,7 @@ SWFInput_readSBits(SWFInput input, int number)
- {
-       int num = SWFInput_readBits(input, number);
- 
--      if ( num & (1<<(number-1)) )
-+      if(number && num & (1<<(number-1)))
-               return num - (1<<number);
-       else
-               return num;

Added: py3.patch
===================================================================
--- py3.patch                           (rev 0)
+++ py3.patch   2020-09-12 02:29:08 UTC (rev 703086)
@@ -0,0 +1,207 @@
+From d59080d266fae60b8c5b28fbcb1696d291d5e419 Mon Sep 17 00:00:00 2001
+From: Connor Behan <[email protected]>
+Date: Sat, 12 Sep 2020 03:05:02 +0100
+Subject: [PATCH] Python 3
+
+---
+ ming.i         |  5 +--
+ py_ext/ming.py | 92 +++++++++++++++++++++++++-------------------------
+ 2 files changed, 49 insertions(+), 48 deletions(-)
+
+diff --git a/ming.i b/ming.i
+index 7ebcaa2d..314d15bc 100644
+--- a/ming.i
++++ b/ming.i
+@@ -12,11 +12,12 @@
+ %}
+ 
+ %typemap(python,in) FILE * {
+-  if (!PyFile_Check($input)) {
++  int temp = PyObject_AsFileDescriptor($input);
++  if (temp == -1) {
+     PyErr_SetString(PyExc_TypeError, "Need a file!");
+     return NULL;
+   }
+-  $1 = PyFile_AsFile($input);
++  $1 = fdopen(temp, "r");
+ }
+ 
+ %typemap(python,in) char * {
+diff --git a/py_ext/ming.py b/py_ext/ming.py
+index 1e23649b..f993aa2f 100644
+--- a/py_ext/ming.py
++++ b/py_ext/ming.py
+@@ -112,57 +112,57 @@ class SWFFilter(SWFBase):
+         if type == SWFFILTER_TYPE_DROPSHADOW:
+             #color, blur, shadow, flags
+             if not isinstance(arg2, SWFBlur):
+-                raise AttributeError, "3. parameter has to be SWFBlur"
++                raise AttributeError("3. parameter has to be SWFBlur")
+             if not isinstance(arg3, SWFShadow):
+-                raise AttributeError, "4. parameter has to be SWFShadow"
++                raise AttributeError("4. parameter has to be SWFShadow")
+             self.this = mingc.newDropShadowFilter(arg1, arg2.this, arg3.this, 
arg4)
+         elif type == SWFFILTER_TYPE_BLUR:
+             #blur
+             if not isinstance(arg1, SWFBlur):
+-                raise AttributeError, "2. parameter has to be SWFBlur"
++                raise AttributeError("2. parameter has to be SWFBlur")
+             self.this = mingc.newBlurFilter(arg1.this)
+         elif type == SWFFILTER_TYPE_GLOW:
+             #color, blur, strength, flags
+             if not isinstance(arg2, SWFBlur):
+-                raise AttributeError, "3. parameter has to be SWFBlur"
++                raise AttributeError("3. parameter has to be SWFBlur")
+             self.this = mingc.newGlowFilter(arg1, arg2.this, arg3, arg4)
+-      elif type == SWFFILTER_TYPE_BEVEL:
++        elif type == SWFFILTER_TYPE_BEVEL:
+             #shadowColor, highlightColor, blur, shadow, flags
+             if not isinstance(arg3, SWFBlur):
+-                raise AttributeError, "4. parameter has to be SWFBlur"
++                raise AttributeError("4. parameter has to be SWFBlur")
+             if not isinstance(arg4, SWFShadow):
+-                raise AttributeError, "5. parameter has to be SWFShadow"
++                raise AttributeError("5. parameter has to be SWFShadow")
+             self.this = mingc.newBevelFilte(arg1, arg2, arg3.this, arg4.this, 
arg5)
+-      elif type == SWFFILTER_TYPE_GRADIENTGLOW:
++        elif type == SWFFILTER_TYPE_GRADIENTGLOW:
+             #gradient, blur, shadow, flags
+             if not isinstance(arg1, SWFGradient):
+-                raise AttributeError, "2. parameter has to be SWFGradient"
++                raise AttributeError("2. parameter has to be SWFGradient")
+             if not isinstance(arg2, SWFBlur):
+-                raise AttributeError, "3. parameter has to be SWFBlur"
++                raise AttributeError("3. parameter has to be SWFBlur")
+             if not isinstance(arg3, SWFShadow):
+-                raise AttributeError, "4. parameter has to be SWFShadow"
++                raise AttributeError("4. parameter has to be SWFShadow")
+             self.this = mingc.newGradienGlowFilter(arg1.this, arg2.this, 
arg3.this, arg4)
+         elif type == SWFFILTER_TYPE_COLORMATRIX:
+             #colormatrix
+             if not isinstance(arg1, SWFFilterMatrix):
+-                raise AttributeError, "2. parameter has to be SWFFilterMatrix"
++                raise AttributeError("2. parameter has to be SWFFilterMatrix")
+             self.this = mingc.newColorMatrixFilter(arg1.this)
+-      elif type == SWFFILTER_TYPE_CONVOLUTION:
++        elif type == SWFFILTER_TYPE_CONVOLUTION:
+             #colormatrix, divisor, bias, color, flags
+             if not isinstance(arg1, SWFFilterMatrix):
+-                raise AttributeError, "2. parameter has to be SWFFilterMatrix"
++                raise AttributeError("2. parameter has to be SWFFilterMatrix")
+             self.this = mingc.newConvolutionFilter(arg1.this, arg2, arg3, 
arg4, arg5)
+         elif type == SWFFILTER_TYPE_GRADIENTBEVEL:
+             #gradient, blur, shadow, flags
+             if not isinstance(arg1, SWFGradient):
+-                raise AttributeError, "2. parameter has to be SWFGradient"
++                raise AttributeError("2. parameter has to be SWFGradient")
+             if not isinstance(arg2, SWFBlur):
+-                raise AttributeError, "3. parameter has to be SWFBlur"
++                raise AttributeError("3. parameter has to be SWFBlur")
+             if not isinstance(arg3, SWFShadow):
+-                raise AttributeError, "4. parameter has to be SWFShadow"
++                raise AttributeError("4. parameter has to be SWFShadow")
+             self.this = mingc.newGradientBevelFilter(arg1.this, arg2.this, 
arg3.this, arg4)
+-      else:
+-            raise AttributeError, "bad filter type to SWFFilter::new"
++        else:
++            raise AttributeError("bad filter type to SWFFilter::new")
+ 
+ class SWFMatrix(SWFBase):
+     
+@@ -230,7 +230,7 @@ class SWFShape(SWFBase):
+             return SWFFill(mingc.SWFShape_addBitmapFill(self.this, arg1.this, 
arg2))
+ 
+         else:
+-            raise AttributeError, "bad argument to SWFShape::addFill"
++            raise AttributeError("bad argument to SWFShape::addFill")
+ 
+     def setLeftFill(self, fill):
+         mingc.SWFShape_setLeftFill(self.this, fill)
+@@ -455,29 +455,29 @@ class SWFDisplayItem(SWFBase):
+         mingc.SWFDisplayItem_setMaskLevel(self.this, level)
+ 
+     def getPositionX(self):
+-      x = mingc.new_floatp()
+-      y = mingc.new_floatp()
+-      mingc.SWFDisplayItem_getPosition(self.this, x, y)
+-      ret = mingc.floatp_value(x)
+-      mingc.delete_floatp(x)
+-      mingc.delete_floatp(y)
+-      return ret
++        x = mingc.new_floatp()
++        y = mingc.new_floatp()
++        mingc.SWFDisplayItem_getPosition(self.this, x, y)
++        ret = mingc.floatp_value(x)
++        mingc.delete_floatp(x)
++        mingc.delete_floatp(y)
++        return ret
+ 
+     def getPositionY(self):
+-      x = mingc.new_floatp()
+-      y = mingc.new_floatp()
+-      mingc.SWFDisplayItem_getPosition(self.this, x, y)
+-      ret = mingc.floatp_value(y)
+-      mingc.delete_floatp(x)
+-      mingc.delete_floatp(y)
+-      return ret
++        x = mingc.new_floatp()
++        y = mingc.new_floatp()
++        mingc.SWFDisplayItem_getPosition(self.this, x, y)
++        ret = mingc.floatp_value(y)
++        mingc.delete_floatp(x)
++        mingc.delete_floatp(y)
++        return ret
+ 
+     def getRotation(self):
+         rot = mingc.new_floatp()
+-      mingc.SWFDisplayItem_getRotation(self.this, rot)
+-      ret = mingc.floatp_value(rot)
+-      mingc.delete_floatp(rot)
+-      return ret
++        mingc.SWFDisplayItem_getRotation(self.this, rot)
++        ret = mingc.floatp_value(rot)
++        mingc.delete_floatp(rot)
++        return ret
+ 
+     def getScaleX(self):
+         sx = mingc.new_floatp()
+@@ -525,7 +525,7 @@ class SWFDisplayItem(SWFBase):
+         return SWFMatrix(mingc.SWFDisplayItem_getMatrix(self.this))
+ 
+     def setCXform(self, cx):
+-      mingc.SWFDisplayItem_setCXform(self.this, cx.this);
++        mingc.SWFDisplayItem_setCXform(self.this, cx.this);
+          
+     def addFilter(self, filter):
+         mingc.SWFDisplayItem_addFilter(self.this, filter.this)
+@@ -644,7 +644,7 @@ class SWFMovie(SWFBase):
+         mingc.SWFMovie_writeExports(self.this)
+ 
+     def assignSymbol(self, character, name):
+-      mingc.SWFMovie_assignSymbol(self.this, character.this, name)
++        mingc.SWFMovie_assignSymbol(self.this, character.this, name)
+       
+     def setNetworkAccess(self, flag):
+         mingc.SWFMovie_setNetworkAccess(self.this, flag)
+@@ -1205,12 +1205,12 @@ SWFVIDEOSTREAM_MODE_MANUAL = 
mingc.SWFVIDEOSTREAM_MODE_MANUAL
+ 
+ class SWFVideoStream(SWFBase):
+     def __init__(self, filename=None):
+-      if filename is None:
+-              self.file = 0;
+-              self.this = mingc.newSWFVideoStream()
+-      else:
+-              self.file = open(filename, "rb");
+-              self.this = mingc.newSWFVideoStream_fromFile(self.file)
++        if filename is None:
++                self.file = 0;
++                self.this = mingc.newSWFVideoStream()
++        else:
++                self.file = open(filename, "rb");
++                self.this = mingc.newSWFVideoStream_fromFile(self.file)
+     def setDimension(self, w, h):
+         return mingc.SWFVideoStream_setDimension(self.this, w, h)
+     def getNumFrames(self):
+-- 
+2.21.0
+

Deleted: python3.patch
===================================================================
--- python3.patch       2020-09-12 02:28:29 UTC (rev 703085)
+++ python3.patch       2020-09-12 02:29:08 UTC (rev 703086)
@@ -1,102 +0,0 @@
-From 4db8a8a45301b21c78d285abd16617457be260dc Mon Sep 17 00:00:00 2001
-From: Connor Behan <[email protected]>
-Date: Thu, 2 Jan 2020 17:22:05 -0500
-Subject: [PATCH] Python3
-
----
- macros/python.m4 | 28 ++++++++++++++--------------
- 1 file changed, 14 insertions(+), 14 deletions(-)
-
-diff --git a/macros/python.m4 b/macros/python.m4
-index 30c68cd5..fdab8e03 100644
---- a/macros/python.m4
-+++ b/macros/python.m4
-@@ -94,8 +94,8 @@ AC_DEFUN([AC_PYTHON_DEVEL],[
-       #
-       AC_MSG_CHECKING([for a version of Python >= '2.1.0'])
-       ac_supports_python_ver=`$PYTHON -c "import sys, string; \
--              ver = string.split(sys.version)[[0]]; \
--              print ver >= '2.1.0'"`
-+              ver = sys.version.split()[[0]]; \
-+              print(ver >= '2.1.0')"`
-       if test "$ac_supports_python_ver" != "True"; then
-               if test -z "$PYTHON_NOVERSIONCHECK"; then
-                       AC_MSG_RESULT([no])
-@@ -121,8 +121,8 @@ to something else than an empty string.
-       if test -n "$1"; then
-               AC_MSG_CHECKING([for a version of Python $1])
-               ac_supports_python_ver=`$PYTHON -c "import sys, string; \
--                      ver = string.split(sys.version)[[0]]; \
--                      print ver $1"`
-+                      ver = sys.version.split()[[0]]; \
-+                      print(ver $1)"`
-               if test "$ac_supports_python_ver" = "True"; then
-                  AC_MSG_RESULT([yes])
-               else
-@@ -157,7 +157,7 @@ $ac_distutils_result])
-       AC_MSG_CHECKING([for Python include path])
-       if test -z "$PYTHON_CPPFLAGS"; then
-               python_path=`$PYTHON -c "import distutils.sysconfig; \
--                      print distutils.sysconfig.get_python_inc();"`
-+                      print(distutils.sysconfig.get_python_inc());"`
-               if test -n "${python_path}"; then
-                       python_path="-I$python_path"
-               fi
-@@ -174,21 +174,21 @@ $ac_distutils_result])
-               # (makes two attempts to ensure we've got a version number
-               # from the interpreter)
-               py_version=`$PYTHON -c "from distutils.sysconfig import *; \
--                      from string import join; \
--                      print join(get_config_vars('VERSION'))"`
-+                      from string import whitespace; \
-+                      print(' '.join(get_config_vars('VERSION')))"`
-               if test "$py_version" = "[None]"; then
-                       if test -n "$PYTHON_VERSION"; then
-                               py_version=$PYTHON_VERSION
-                       else
-                               py_version=`$PYTHON -c "import sys; \
--                                      print sys.version[[:3]]"`
-+                                      print(sys.version[[:3]])"`
-                       fi
-               fi
- 
-               PYTHON_LDFLAGS=`$PYTHON -c "from distutils.sysconfig import *; \
--                      from string import join; \
--                      print '-L' + get_python_lib(0,1), \
--                      '-lpython';"`$py_version
-+                      from string import whitespace; \
-+                      print('-L' + get_python_lib(0,1), \
-+                      '-lpython');"`$py_version
-       fi
-       AC_MSG_RESULT([$PYTHON_LDFLAGS])
-       AC_SUBST([PYTHON_LDFLAGS])
-@@ -199,7 +199,7 @@ $ac_distutils_result])
-       AC_MSG_CHECKING([for Python site-packages path])
-       if test -z "$PYTHON_SITE_PKG"; then
-               PYTHON_SITE_PKG=`$PYTHON -c "import distutils.sysconfig; \
--                      print distutils.sysconfig.get_python_lib(0,0);"`
-+                      print(distutils.sysconfig.get_python_lib(0,0));"`
-       fi
-       AC_MSG_RESULT([$PYTHON_SITE_PKG])
-       AC_SUBST([PYTHON_SITE_PKG])
-@@ -211,7 +211,7 @@ $ac_distutils_result])
-       if test -z "$PYTHON_EXTRA_LIBS"; then
-          PYTHON_EXTRA_LIBS=`$PYTHON -c "import distutils.sysconfig; \
-                 conf = distutils.sysconfig.get_config_var; \
--                print conf('LOCALMODLIBS'), conf('LIBS')"`
-+                print(conf('LOCALMODLIBS') + ' ' + conf('LIBS'))"`
-       fi
-       AC_MSG_RESULT([$PYTHON_EXTRA_LIBS])
-       AC_SUBST(PYTHON_EXTRA_LIBS)
-@@ -223,7 +223,7 @@ $ac_distutils_result])
-       if test -z "$PYTHON_EXTRA_LDFLAGS"; then
-               PYTHON_EXTRA_LDFLAGS=`$PYTHON -c "import distutils.sysconfig; \
-                       conf = distutils.sysconfig.get_config_var; \
--                      print conf('LINKFORSHARED')"`
-+                      print(conf('LINKFORSHARED'))"`
-       fi
-       AC_MSG_RESULT([$PYTHON_EXTRA_LDFLAGS])
-       AC_SUBST(PYTHON_EXTRA_LDFLAGS)
--- 
-2.21.0
-

Reply via email to