Crash when changing video subtitles.
authorpvollan@apple.com <pvollan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Jan 2017 18:45:59 +0000 (18:45 +0000)
committerpvollan@apple.com <pvollan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Jan 2017 18:45:59 +0000 (18:45 +0000)
https://bugs.webkit.org/show_bug.cgi?id=167159

Reviewed by Xabier Rodriguez-Calvar.

Add null pointer check.

* html/track/VTTCue.cpp:
(WebCore::VTTCue::removeDisplayTree):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210855 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/html/track/VTTCue.cpp

index f153deb..06ee631 100644 (file)
@@ -1,3 +1,15 @@
+2017-01-18  Per Arne Vollan  <pvollan@apple.com>
+
+        Crash when changing video subtitles.
+        https://bugs.webkit.org/show_bug.cgi?id=167159
+
+        Reviewed by Xabier Rodriguez-Calvar.
+
+        Add null pointer check.
+
+        * html/track/VTTCue.cpp:
+        (WebCore::VTTCue::removeDisplayTree):
+
 2017-01-18  Youenn Fablet  <youenn@apple.com>
 
         [Fetch API] Update content-type in case of form data
index ba58036..92f615c 100644 (file)
@@ -838,7 +838,8 @@ void VTTCue::removeDisplayTree()
     if (m_notifyRegion && track()) {
         if (VTTRegionList* regions = track()->regions()) {
             if (VTTRegion* region = regions->getRegionById(m_regionId))
-                region->willRemoveTextTrackCueBox(m_displayTree.get());
+                if (hasDisplayTree())
+                    region->willRemoveTextTrackCueBox(m_displayTree.get());
         }
     }