Do not crash if there is no magic cookie.

This commit is contained in:
Damiano Galassi committed 2017-09-22 14:28:36 +02:00
1 parent 807dcb8e01
commit dc661b2e80
1 file changed
+4
+4
View File
@@ -743,6 +743,10 @@
size_t cookieSizeOut;
const void *cookieBuffer = CMAudioFormatDescriptionGetMagicCookie(formatDescription, &cookieSizeOut);
if (cookieBuffer == NULL || cookieSizeOut == 0) {
return nil;
}
if (code == kAudioFormatMPEG4AAC || code == kAudioFormatMPEG4AAC_HE || code == kAudioFormatMPEG4AAC_HE_V2) {
// Extract DecoderSpecific info