File: _portaudiomodule.c
Function: pa_is_format_supported
Error: ob_refcnt of new ref from call to Py_BuildValue is 1 too high
1772 static PyObject *
1773 pa_is_format_supported(PyObject *self, PyObject *args,
1774 		       PyObject *kwargs)
1775 {
1776   /* pass in rate, channel, width */
1777   static char *kwlist[] = {
1778       "sample_rate",
1779       "input_device",
1780       "input_channels",
1781       "input_format",
1782       "output_device",
1783       "output_channels",
1784       "output_format",
1785       NULL
1786   };
1787 
1788   int input_device, input_channels;
1789   int output_device, output_channels;
1790   float sample_rate;
1791   PaStreamParameters inputParams;
1792   PaStreamParameters outputParams;
1793   PaSampleFormat input_format, output_format;
1794   PaError error;
1795 
1796   input_device = input_channels =
1797     output_device = output_channels = -1;
1798 
1799   input_format = output_format = -1;
1800 
1801   if (!PyArg_ParseTupleAndKeywords(args, kwargs, "f|iikiik", kwlist,
when PyArg_ParseTupleAndKeywords() succeeds
taking False path
1802 				   &sample_rate,
1803 				   &input_device,
1804 				   &input_channels,
1805 				   &input_format,
1806 				   &output_device,
1807 				   &output_channels,
1808 				   &output_format))
1809     return NULL;
1810 
1811   if (!(input_device < 0)) {
when considering range: -0x80000000 <= value <= -1
taking False path
1812     inputParams.device = input_device;
1813     inputParams.channelCount = input_channels;
1814     inputParams.sampleFormat = input_format;
1815     inputParams.suggestedLatency = 0;
1816     inputParams.hostApiSpecificStreamInfo = NULL;
1817   }
1818 
1819   if (!(output_device < 0)) {
when considering range: -0x80000000 <= value <= -1
taking False path
1820     outputParams.device = output_device;
1821     outputParams.channelCount = output_channels;
1822     outputParams.sampleFormat = output_format;
1823     outputParams.suggestedLatency = 0;
1824     outputParams.hostApiSpecificStreamInfo = NULL;
1825   }
1826 
1827   error = Pa_IsFormatSupported((input_device < 0) ? NULL : &inputParams,
taking False path
taking False path
1828 			       (output_device < 0) ? NULL : &outputParams,
1829 			       sample_rate);
1830 
1831   if (error == paFormatIsSupported) {
when considering range: -0x80000000 <= value <= -1
taking False path
1832     Py_INCREF(Py_True);
1833     return Py_True;
1834   } else {
1835     PyErr_SetObject(PyExc_ValueError,
when Py_BuildValue() succeeds
calling PyErr_SetObject()
new ref from call to Py_BuildValue allocated at:     PyErr_SetObject(PyExc_ValueError,
ob_refcnt is now refs: 1 + N where N >= 0
ob_refcnt is now refs: 1 + N where N >= 1
1836 		    Py_BuildValue("(s,i)",
1837 				  Pa_GetErrorText(error),
1838 				  error));
1839     return NULL;
1840   }
1841 }
ob_refcnt of new ref from call to Py_BuildValue is 1 too high
was expecting final ob_refcnt to be N + 0 (for some unknown N)
but final ob_refcnt is N + 1
found 7 similar trace(s) to this