We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1c4953a commit 4e9feccCopy full SHA for 4e9fecc
src/detection/sound/sound_bsd.c
@@ -15,10 +15,11 @@ const char* ffDetectSound(FFlist* devices)
15
#else
16
int defaultDev;
17
{
18
- char mixerp[8];
19
- if (readlink("/dev/mixer", mixerp, ARRAY_SIZE(mixerp)) != 6)
+ char mixerp[12];
+ ssize_t plen = readlink("/dev/mixer", mixerp, ARRAY_SIZE(mixerp));
20
+ if (plen < 6)
21
return "readlink(/dev/mixer) failed";
- defaultDev = mixerp[5] - '0';
22
+ defaultDev = mixerp[plen - 1] - '0';
23
if (defaultDev < 0 || defaultDev > 9)
24
return "Invalid mixer device";
25
}
0 commit comments