Bug 1446932 - Handle nullptr in FlacFrameParser::GetTags. r?jya draft
authorChristian Holler <choller@mozilla.com>
Tue, 27 Mar 2018 13:02:15 +0200
changeset 773109 3a2fc9fed74983b8c2e76b0b4352ef0ae19691bd
parent 773108 267a6fa83b7346da511e107fb2c7b426c956dfba
push id104124
push usercholler@mozilla.com
push dateTue, 27 Mar 2018 11:02:54 +0000
reviewersjya
bugs1446932
milestone61.0a1
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());
   }