From c598df2e7e4923936319869744f649043a8a80a2 Mon Sep 17 00:00:00 2001 From: "jer.noble@apple.com" Date: Fri, 6 Mar 2015 19:31:16 +0000 Subject: [PATCH] [Web Audio] Decoding specific .m4a file crashes tab https://bugs.webkit.org/show_bug.cgi?id=139545 Reviewed by Eric Carlson. Source/WebCore: Test: webaudio/decode-audio-data-too-short.html Bail out early if CoreAudio reports the number of frames in the file to be negative. * platform/audio/mac/AudioFileReaderMac.cpp: (WebCore::AudioFileReader::createBus): LayoutTests: * webaudio/decode-audio-data-too-short-expected.txt: Added. * webaudio/decode-audio-data-too-short.html: Added. * webaudio/resources/media/too-short.m4a: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@181174 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- LayoutTests/ChangeLog | 11 ++++++++ .../decode-audio-data-too-short-expected.txt | 9 ++++++ .../webaudio/decode-audio-data-too-short.html | 31 +++++++++++++++++++++ LayoutTests/webaudio/resources/media/too-short.m4a | Bin 0 -> 958 bytes Source/WebCore/ChangeLog | 14 ++++++++++ .../platform/audio/mac/AudioFileReaderMac.cpp | 2 +- 6 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 LayoutTests/webaudio/decode-audio-data-too-short-expected.txt create mode 100644 LayoutTests/webaudio/decode-audio-data-too-short.html create mode 100644 LayoutTests/webaudio/resources/media/too-short.m4a diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog index 04747de..432440b 100644 --- a/LayoutTests/ChangeLog +++ b/LayoutTests/ChangeLog @@ -1,3 +1,14 @@ +2015-03-06 Jer Noble + + [Web Audio] Decoding specific .m4a file crashes tab + https://bugs.webkit.org/show_bug.cgi?id=139545 + + Reviewed by Eric Carlson. + + * webaudio/decode-audio-data-too-short-expected.txt: Added. + * webaudio/decode-audio-data-too-short.html: Added. + * webaudio/resources/media/too-short.m4a: Added. + 2015-03-06 Myles C. Maxfield Crash in -[WebCascadeList objectAtIndex:] + 195 diff --git a/LayoutTests/webaudio/decode-audio-data-too-short-expected.txt b/LayoutTests/webaudio/decode-audio-data-too-short-expected.txt new file mode 100644 index 0000000..1211be5 --- /dev/null +++ b/LayoutTests/webaudio/decode-audio-data-too-short-expected.txt @@ -0,0 +1,9 @@ +Test that decoding an audio file which is too short does not cause a crash. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/LayoutTests/webaudio/decode-audio-data-too-short.html b/LayoutTests/webaudio/decode-audio-data-too-short.html new file mode 100644 index 0000000..640c2f7 --- /dev/null +++ b/LayoutTests/webaudio/decode-audio-data-too-short.html @@ -0,0 +1,31 @@ + + + + + + + + + + + diff --git a/LayoutTests/webaudio/resources/media/too-short.m4a b/LayoutTests/webaudio/resources/media/too-short.m4a new file mode 100644 index 0000000000000000000000000000000000000000..0556926f26c8d37d91a22bbf6ec6756b85677211 GIT binary patch literal 958 zcmZQzV30^FsVvAXFfn2P0w8UeS)8BCz`!V#o03?fo)hZHa_EqwL4b;gATOJeV@H6i zA;+Wx7OWFm6giy49BluaKKop`$L#*onz{Q|9sYCu&-z}8lpkm3|I_~y-*xoA_P_9t z^2ZeRf2P6Wa{rzPzkko?-`{iY_wNau z7mR9Z%;(>~)4=dwUY_~>{W}Z{KYrxiudiib;Q#m`=ik2%^B-LjV(l0EhvK0U$6)Elw#0F_;?~ z8svdA3y>CZ5M_`6>L~|fR-g!zkN_JaDEuUfOG?1%fozbOKrt2|#UKN;I~l|P0+2XV z4orjOs=zW30%Xp8AT|bKk>Zl%e26eutpboO08|gN10>~Ano^Poq)l>D!8Axr0Xb}e W@c|EKkR%XrWabo?fanNdf&c(vR@SKi literal 0 HcmV?d00001 diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index f7edd6a..c85ab8a 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,17 @@ +2015-03-06 Jer Noble + + [Web Audio] Decoding specific .m4a file crashes tab + https://bugs.webkit.org/show_bug.cgi?id=139545 + + Reviewed by Eric Carlson. + + Test: webaudio/decode-audio-data-too-short.html + + Bail out early if CoreAudio reports the number of frames in the file to be negative. + + * platform/audio/mac/AudioFileReaderMac.cpp: + (WebCore::AudioFileReader::createBus): + 2015-03-06 Jeremy Jones Scroll to make the video element visible when exiting fullscreen. diff --git a/Source/WebCore/platform/audio/mac/AudioFileReaderMac.cpp b/Source/WebCore/platform/audio/mac/AudioFileReaderMac.cpp index 6c9225a..8df1365 100644 --- a/Source/WebCore/platform/audio/mac/AudioFileReaderMac.cpp +++ b/Source/WebCore/platform/audio/mac/AudioFileReaderMac.cpp @@ -147,7 +147,7 @@ PassRefPtr AudioFileReader::createBus(float sampleRate, bool mixToMono SInt64 numberOfFrames64 = 0; size = sizeof(numberOfFrames64); result = ExtAudioFileGetProperty(m_extAudioFileRef, kExtAudioFileProperty_FileLengthFrames, &size, &numberOfFrames64); - if (result != noErr) + if (result != noErr || numberOfFrames64 <= 0) return 0; // Sample-rate -- 1.8.3.1