Bug 1446932 - Handle nullptr in FlacFrameParser::GetTags. r=jya
authorChristian Holler <choller@mozilla.com>
Tue, 27 Mar 2018 13:02:15 +0200
changeset 410185 f5bd43e4e83d469e7414c219196c64b0aac9bba5
parent 410184 5c9399f5449f05e0355b5e78f6bb66471fe07d01
child 410186 1bf748eb2dcf6405eda05e8e764291e5ca44007b
push id33722
push userebalazs@mozilla.com
push dateTue, 27 Mar 2018 21:47:13 +0000
treeherdermozilla-central@e62adc04f769 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjya
bugs1446932
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1446932 - Handle nullptr in FlacFrameParser::GetTags. r=jya MozReview-Commit-ID: I50zXqUUD7x
dom/media/flac/FlacFrameParser.cpp
--- a/dom/media/flac/FlacFrameParser.cpp
+++ b/dom/media/flac/FlacFrameParser.cpp
@@ -233,16 +233,20 @@ FlacFrameParser::IsHeaderBlock(const uin
   }
   char type = aPacket[0] & 0x7f;
   return type >= 1 && type <= 6;
 }
 
 MetadataTags*
 FlacFrameParser::GetTags() const
 {
+  if (!mParser) {
+    return nullptr;
+  }
+
   MetadataTags* tags;
 
   tags = new MetadataTags;
   for (uint32_t i = 0; i < mParser->mTags.Length(); i++) {
     OggCodecState::AddVorbisComment(tags,
                                     mParser->mTags[i].Data(),
                                     mParser->mTags[i].Length());
   }