Bug 976023 - Fix crash in AppleMP3Reader. r=rillian, a=sledru
authorEdwin Flores <eflores@mozilla.com>
Wed, 24 Sep 2014 10:46:17 +1200
changeset 216846 f2933e32b654
parent 216845 a703ff0c7861
child 216847 e60e089a7904
push id3940
push userryanvm@gmail.com
push date2014-09-25 16:25 +0000
treeherdermozilla-beta@09dcf9d94d33 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrillian, sledru
bugs976023
milestone33.0
Bug 976023 - Fix crash in AppleMP3Reader. r=rillian, a=sledru
content/media/apple/AppleMP3Reader.cpp
--- a/content/media/apple/AppleMP3Reader.cpp
+++ b/content/media/apple/AppleMP3Reader.cpp
@@ -161,16 +161,20 @@ const UInt32 kNeedMoreData = 'MOAR';
  */
 /* static */ OSStatus
 AppleMP3Reader::PassthroughInputDataCallback(AudioConverterRef aAudioConverter,
                                              UInt32 *aNumDataPackets /* in/out */,
                                              AudioBufferList *aData /* in/out */,
                                              AudioStreamPacketDescription **aPacketDesc,
                                              void *aUserData)
 {
+  if (!aPacketDesc) {
+    return kAudioFileStreamError_UnspecifiedError;
+  }
+
   PassthroughUserData *userData = (PassthroughUserData *)aUserData;
   if (userData->mDone) {
     // We make sure this callback is run _once_, with all the data we received
     // from |AudioFileStreamParseBytes|. When we return an error, the decoder
     // simply passes the return value on to the calling method,
     // |AudioSampleCallback|; and flushes all of the audio frames it had
     // buffered. It does not change the decoder's state.
     LOGD("requested too much data; returning\n");