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 . pyvorbis (1.5-1) unstable; urgency=low . * New upstream release - FILE* gets no longer double fclose()'d; thanks to Dave Wong for the report; Closes: #627144 * debian/patches/01_previous_changes.dpatch - adapted to new upstream code * debian/patches/03_double_free_fix.dpatch - removed, merged upstream * debian/control - added misc:Depends to Depends lines - added X-P-V source header - bump Standards-Version to 3.9.2 (no changes needed) - removed Provides * debian/rules - put strip info in the right place - fixed build* targets * Converted to 3.0 (quilt) format (patches included) * debian/pycompat - removed, not needed * debian/README.source - removed, not needed anymore Author: Sandro Tosi Bug-Debian: http://bugs.debian.org/627144 --- The information above should follow the Patch Tagging Guidelines, please checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here are templates for supplementary fields that you might want to add: Origin: , Bug: Bug-Debian: http://bugs.debian.org/ Bug-Ubuntu: https://launchpad.net/bugs/ Forwarded: Reviewed-By: Last-Update: --- 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; }