mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-12-22 19:36:29 +01:00
Fix segfault with no-capture devices
Fix segfault on the device without capture controls when the view is changed to capture mode (bug #1080).
This commit is contained in:
parent
b45a11b0ed
commit
34e3b1c783
1 changed files with 2 additions and 2 deletions
|
@ -1679,12 +1679,12 @@ __again:
|
|||
|
||||
if (mixer_type)
|
||||
free(mixer_type);
|
||||
mixer_type = (int *)malloc(sizeof(int) * mixer_n_elems);
|
||||
mixer_type = (int *)calloc(mixer_n_elems, sizeof(int));
|
||||
if (mixer_type == NULL)
|
||||
mixer_abort(ERR_FCN, "malloc", 0);
|
||||
if (mixer_grpidx)
|
||||
free(mixer_grpidx);
|
||||
mixer_grpidx = (int *)malloc(sizeof(int) * mixer_n_elems);
|
||||
mixer_grpidx = (int *)calloc(mixer_n_elems, sizeof(int));
|
||||
if (mixer_grpidx == NULL)
|
||||
mixer_abort(ERR_FCN, "malloc", 0);
|
||||
elem_index = 0;
|
||||
|
|
Loading…
Reference in a new issue