File: | alsaaudio.c |
Function: | alsamixer_getmute |
Error: | dereferencing NULL (item->ob_refcnt) at alsaaudio.c:1647 |
1612 static PyObject *
1613 alsamixer_getmute(alsamixer_t *self, PyObject *args)
1614 {
1615 snd_mixer_elem_t *elem;
1616 int i;
1617 int ival;
1618 PyObject *result;
1619 PyObject *item;
1620
1621 if (!PyArg_ParseTuple(args,":getmute"))
when PyArg_ParseTuple() succeeds
taking False path
1622 return NULL;
1623
1624 if (!self->handle)
when treating unknown struct snd_mixer_t * from alsaaudio.c:1624 as non-NULL
taking False path
1625 {
1626 PyErr_SetString(ALSAAudioError, "Mixer is closed");
1627 return NULL;
1628 }
1629
1630 elem = alsamixer_find_elem(self->handle,self->controlname,self->controlid);
1631 if (!snd_mixer_selem_has_playback_switch(elem))
when considering range: -0x80000000 <= value <= -1
taking False path
1632 {
1633 PyErr_SetString(ALSAAudioError,"Mixer has no mute switch");
1634 return NULL;
1635 }
1636
1637 result = PyList_New(0);
when PyList_New() succeeds
1638
1639 for (i = 0; i <= SND_MIXER_SCHN_LAST; i++)
taking True path
1640 {
1641 if (snd_mixer_selem_has_playback_channel(elem, i))
when considering range: -0x80000000 <= value <= -1
taking True path
1642 {
1643 snd_mixer_selem_get_playback_switch(elem, i, &ival);
1644
1645 item = PyLong_FromLong(!ival);
when PyLong_FromLong() fails
1646 PyList_Append(result, item);
returning -1 from PyList_Append() due to NULL item
1647 Py_DECREF(item);
dereferencing NULL (item->ob_refcnt) at alsaaudio.c:1647
found 3 similar trace(s) to this
1648 }
1649 }
1650 return result;
1651 }
File: | alsaaudio.c |
Function: | alsamixer_getmute |
Error: | calling PyList_Append with NULL as argument 1 (result) at alsaaudio.c:1646 |
1612 static PyObject *
1613 alsamixer_getmute(alsamixer_t *self, PyObject *args)
1614 {
1615 snd_mixer_elem_t *elem;
1616 int i;
1617 int ival;
1618 PyObject *result;
1619 PyObject *item;
1620
1621 if (!PyArg_ParseTuple(args,":getmute"))
when PyArg_ParseTuple() succeeds
taking False path
1622 return NULL;
1623
1624 if (!self->handle)
when treating unknown struct snd_mixer_t * from alsaaudio.c:1624 as non-NULL
taking False path
1625 {
1626 PyErr_SetString(ALSAAudioError, "Mixer is closed");
1627 return NULL;
1628 }
1629
1630 elem = alsamixer_find_elem(self->handle,self->controlname,self->controlid);
1631 if (!snd_mixer_selem_has_playback_switch(elem))
when considering range: -0x80000000 <= value <= -1
taking False path
1632 {
1633 PyErr_SetString(ALSAAudioError,"Mixer has no mute switch");
1634 return NULL;
1635 }
1636
1637 result = PyList_New(0);
when PyList_New() fails
1638
1639 for (i = 0; i <= SND_MIXER_SCHN_LAST; i++)
taking True path
1640 {
1641 if (snd_mixer_selem_has_playback_channel(elem, i))
when considering range: -0x80000000 <= value <= -1
taking True path
1642 {
1643 snd_mixer_selem_get_playback_switch(elem, i, &ival);
1644
1645 item = PyLong_FromLong(!ival);
when PyLong_FromLong() succeeds
1646 PyList_Append(result, item);
calling PyList_Append with NULL as argument 1 (result) at alsaaudio.c:1646
PyList_Append() invokes Py_TYPE() on the pointer via the PyList_Check() macro, thus accessing (NULL)->ob_type
found 7 similar trace(s) to this
1647 Py_DECREF(item);
1648 }
1649 }
1650 return result;
1651 }