[Python-modules-commits] r23209 - in packages/pyvorbis/trunk/debian (3 files)
morph at users.alioth.debian.org
morph at users.alioth.debian.org
Wed Dec 26 11:37:30 UTC 2012
Date: Wednesday, December 26, 2012 @ 11:37:28
Author: morph
Revision: 23209
* debian/patches/03_fix_call_to_ov_read.patch
- fix a crash ("Floating point exception") when calling read(); thanks to
Alessio Gaeta for the report and to Emmanuel Anne for the patch;
Closes: #696640
Added:
packages/pyvorbis/trunk/debian/patches/03_fix_call_to_ov_read.patch
Modified:
packages/pyvorbis/trunk/debian/changelog
packages/pyvorbis/trunk/debian/patches/series
Modified: packages/pyvorbis/trunk/debian/changelog
===================================================================
--- packages/pyvorbis/trunk/debian/changelog 2012-12-25 07:40:35 UTC (rev 23208)
+++ packages/pyvorbis/trunk/debian/changelog 2012-12-26 11:37:28 UTC (rev 23209)
@@ -1,3 +1,12 @@
+pyvorbis (1.5-2) UNRELEASED; urgency=low
+
+ * debian/patches/03_fix_call_to_ov_read.patch
+ - fix a crash ("Floating point exception") when calling read(); thanks to
+ Alessio Gaeta for the report and to Emmanuel Anne for the patch;
+ Closes: #696640
+
+ -- Sandro Tosi <morph at debian.org> Wed, 26 Dec 2012 12:36:28 +0100
+
pyvorbis (1.5-1) unstable; urgency=low
* New upstream release
Added: packages/pyvorbis/trunk/debian/patches/03_fix_call_to_ov_read.patch
===================================================================
--- packages/pyvorbis/trunk/debian/patches/03_fix_call_to_ov_read.patch (rev 0)
+++ packages/pyvorbis/trunk/debian/patches/03_fix_call_to_ov_read.patch 2012-12-26 11:37:28 UTC (rev 23209)
@@ -0,0 +1,90 @@
+Description: Fix the crash/no sound while trying to play fofix/guitar hero
+ This mod was trying to force a prototype on an array of callbacks, it's a
+ miracle that it ever worked, maybe older versions of python were more
+ forgiving, or recent versions of libc don't let this kind of thing to
+ pass...
+ .
+ Also changed the memory allocation of py_ov_read to something simpler
+Origin: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=670062#10
+Bug-Debian: http://bugs.debian.org/696640
+Forwarded: https://groups.google.com/d/topic/pyogg/IuvxXV5UgP4/discussion
+
+--- pyvorbis-1.5.orig/src/pyvorbisfile.c
++++ pyvorbis-1.5/src/pyvorbisfile.c
+@@ -35,7 +35,7 @@ length is the number of bytes to read\n\
+ \tbigendian is the endianness you want (defaults to host endianness)\n\
+ \tword is the word size\n\tnot sure what signed does\n";
+
+-static PyObject *py_ov_read(PyObject *, PyObject *, PyObject *);
++static PyObject *py_ov_read(PyObject *, PyObject *); // , PyObject *);
+
+ FDEF(ov_streams) "Returns the number of logical streams in this VorbisFile";
+ FDEF(ov_seekable) "Returns whether this VorbisFile is seekable.";
+@@ -119,7 +119,7 @@ PyTypeObject py_vorbisfile_type = {
+
+
+ static PyMethodDef OggVorbis_File_methods[] = {
+- {"read", (PyCFunction) py_ov_read,
++ {"read", py_ov_read,
+ METH_VARARGS | METH_KEYWORDS, py_ov_read_doc},
+ {"info", py_ov_info,
+ METH_VARARGS, py_ov_info_doc},
+@@ -288,7 +288,7 @@ static int is_big_endian() {
+ }
+
+ static PyObject *
+-py_ov_read(PyObject *self, PyObject *args, PyObject *kwdict)
++py_ov_read(PyObject *self, PyObject *args) // , PyObject *kwdict)
+ {
+ py_vorbisfile * ov_self = (py_vorbisfile *) self;
+ PyObject *retobj;
+@@ -298,7 +298,7 @@ py_ov_read(PyObject *self, PyObject *arg
+ PyObject *tuple;
+ char *buff;
+
+- int length, word, sgned, bitstream;
++ int length, word, sgned, bitstream = 0;
+ int bigendianp;
+
+ // Default to host order
+@@ -307,33 +307,23 @@ py_ov_read(PyObject *self, PyObject *arg
+ word = 2;
+ sgned = 1;
+
+- if (!PyArg_ParseTupleAndKeywords(args, kwdict, "|llll", read_kwlist,
++/* if (!PyArg_ParseTupleAndKeywords(args, kwdict, "|llll", read_kwlist,
+ &length, &bigendianp, &word, &sgned))
+- return NULL;
+-
+- buffobj = PyBuffer_New(length);
+-
+- tuple = PyTuple_New(1);
+- Py_INCREF(buffobj);
+- PyTuple_SET_ITEM(tuple, 0, buffobj);
++ return NULL; */
+
+- if (!(PyArg_ParseTuple(tuple, "t#", &buff, &length))) {
+- return NULL;
+- }
+- Py_DECREF(tuple);
++ buff = malloc(length);
++ if (!buff) return NULL;
+
+- Py_BEGIN_ALLOW_THREADS
+ retval = ov_read(ov_self->ovf, buff, length,
+ bigendianp, word, sgned, &bitstream);
+- Py_END_ALLOW_THREADS
+
+ if (retval < 0) {
+- Py_DECREF(buffobj);
++ free(buff);
+ return v_error_from_code(retval, "Error reading file: ");
+ }
+
+- retobj = Py_BuildValue("Oii", buffobj, retval, bitstream);
+- Py_DECREF(buffobj);
++ retobj = Py_BuildValue("s#ii", buff, retval, retval, bitstream);
++ free(buff);
+ return retobj;
+ }
+
Modified: packages/pyvorbis/trunk/debian/patches/series
===================================================================
--- packages/pyvorbis/trunk/debian/patches/series 2012-12-25 07:40:35 UTC (rev 23208)
+++ packages/pyvorbis/trunk/debian/patches/series 2012-12-26 11:37:28 UTC (rev 23209)
@@ -1,2 +1,3 @@
01_previous_changes.patch
02_whrandom_gone.patch
+03_fix_call_to_ov_read.patch
More information about the Python-modules-commits
mailing list