File: | alsaaudio.c |
Function: | alsamixer_list |
Error: | dereferencing NULL (mixer->ob_refcnt) at alsaaudio.c:963 |
929 static PyObject *
930 alsamixer_list(PyObject *self, PyObject *args)
931 {
932 snd_mixer_t *handle;
933 snd_mixer_selem_id_t *sid;
934 snd_mixer_elem_t *elem;
935 int err;
936 int cardidx = 0;
937 char cardname[32];
938 PyObject *result;
939
940 if (!PyArg_ParseTuple(args,"|i:mixers",&cardidx))
when PyArg_ParseTuple() succeeds
taking False path
941 return NULL;
942
943 sprintf(cardname, "hw:%d", cardidx);
944
945 snd_mixer_selem_id_alloca(&sid);
946 err = alsamixer_gethandle(cardname, &handle);
947 if (err < 0)
when considering range: 0 <= value <= 0x7fffffff
taking False path
948 {
949 PyErr_SetString(ALSAAudioError,snd_strerror(err));
950 snd_mixer_close(handle);
951 return NULL;
952 }
953
954 result = PyList_New(0);
when PyList_New() succeeds
955
956 for (elem = snd_mixer_first_elem(handle); elem;
when treating unknown struct snd_mixer_elem_t * from alsaaudio.c:956 as non-NULL
taking True path
957 elem = snd_mixer_elem_next(elem))
958 {
959 PyObject *mixer;
960 snd_mixer_selem_get_id(elem, sid);
961 mixer = PyUnicode_FromString(snd_mixer_selem_id_get_name(sid));
when PyUnicodeUCS4_FromString() fails
962 PyList_Append(result,mixer);
returning -1 from PyList_Append() due to NULL item
963 Py_DECREF(mixer);
dereferencing NULL (mixer->ob_refcnt) at alsaaudio.c:963
964 }
965 snd_mixer_close(handle);
966
967 return result;
968 }
File: | alsaaudio.c |
Function: | alsamixer_list |
Error: | calling PyList_Append with NULL as argument 1 (result) at alsaaudio.c:962 |
929 static PyObject *
930 alsamixer_list(PyObject *self, PyObject *args)
931 {
932 snd_mixer_t *handle;
933 snd_mixer_selem_id_t *sid;
934 snd_mixer_elem_t *elem;
935 int err;
936 int cardidx = 0;
937 char cardname[32];
938 PyObject *result;
939
940 if (!PyArg_ParseTuple(args,"|i:mixers",&cardidx))
when PyArg_ParseTuple() succeeds
taking False path
941 return NULL;
942
943 sprintf(cardname, "hw:%d", cardidx);
944
945 snd_mixer_selem_id_alloca(&sid);
946 err = alsamixer_gethandle(cardname, &handle);
947 if (err < 0)
when considering range: 0 <= value <= 0x7fffffff
taking False path
948 {
949 PyErr_SetString(ALSAAudioError,snd_strerror(err));
950 snd_mixer_close(handle);
951 return NULL;
952 }
953
954 result = PyList_New(0);
when PyList_New() fails
955
956 for (elem = snd_mixer_first_elem(handle); elem;
when treating unknown struct snd_mixer_elem_t * from alsaaudio.c:956 as non-NULL
taking True path
957 elem = snd_mixer_elem_next(elem))
958 {
959 PyObject *mixer;
960 snd_mixer_selem_get_id(elem, sid);
961 mixer = PyUnicode_FromString(snd_mixer_selem_id_get_name(sid));
when PyUnicodeUCS4_FromString() succeeds
962 PyList_Append(result,mixer);
calling PyList_Append with NULL as argument 1 (result) at alsaaudio.c:962
PyList_Append() invokes Py_TYPE() on the pointer via the PyList_Check() macro, thus accessing (NULL)->ob_type
found 1 similar trace(s) to this
963 Py_DECREF(mixer);
964 }
965 snd_mixer_close(handle);
966
967 return result;
968 }