]> git.sesse.net Git - vlc/commitdiff
auhal: fix insufficient bounds checking introduced in [14250ccc]
authorFelix Paul Kühne <fkuehne@videolan.org>
Sat, 16 Feb 2013 20:13:49 +0000 (21:13 +0100)
committerFelix Paul Kühne <fkuehne@videolan.org>
Sat, 16 Feb 2013 20:13:49 +0000 (21:13 +0100)
modules/audio_output/auhal.c

index d56e07555ddf9f97ce01a85bc2cfb27eaa04d941..076da3c78cbda31d667fef58c1dd92ddb29e039d 100644 (file)
@@ -997,6 +997,13 @@ static void RebuildDeviceList(audio_output_t * p_aout)
         bool b_digital = false;
         UInt32 i_id = deviceIDs[i];
 
+        /* Retrieve the length of the device name */
+        err = AudioObjectGetPropertyDataSize(deviceIDs[i], &deviceNameAddress, 0, NULL, &propertySize);
+        if (err != noErr) {
+            msg_Dbg(p_aout, "failed to get name size for device %i", deviceIDs[i]);
+            continue;
+        }
+
         /* Retrieve the name of the device */
         err = AudioObjectGetPropertyData(deviceIDs[i], &deviceNameAddress, 0, NULL, &propertySize, &device_name_ref);
         if (err != noErr) {