Null dereference in InbandMetadataTextTrack handling
authorbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 27 Mar 2015 20:41:33 +0000 (20:41 +0000)
committerbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 27 Mar 2015 20:41:33 +0000 (20:41 +0000)
https://bugs.webkit.org/show_bug.cgi?id=143144
<rdar://problem/18983250>

Reviewed by Eric Carlson.

* platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp:
(WebCore::InbandMetadataTextTrackPrivateAVF::updatePendingCueEndTimes): Check for null return value from
'client()', just like we do in all other methods.

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

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp

index dd67c80..1fcfcff 100644 (file)
@@ -1,3 +1,15 @@
+2015-03-27  Brent Fulgham  <bfulgham@apple.com>
+
+        Null dereference in InbandMetadataTextTrack handling
+        https://bugs.webkit.org/show_bug.cgi?id=143144
+        <rdar://problem/18983250>
+
+        Reviewed by Eric Carlson.
+
+        * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp:
+        (WebCore::InbandMetadataTextTrackPrivateAVF::updatePendingCueEndTimes): Check for null return value from
+        'client()', just like we do in all other methods.
+
 2015-03-27  Oliver Hunt  <oliver@apple.com>
 
         Forward additional CFNetwork ATS information to child processes
index 78135fd..0a59cd0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014-2015 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -71,9 +71,11 @@ void InbandMetadataTextTrackPrivateAVF::addDataCue(const MediaTime& start, const
 void InbandMetadataTextTrackPrivateAVF::updatePendingCueEndTimes(const MediaTime& time)
 {
     if (time >= m_currentCueStartTime) {
-        for (auto& partialCue : m_incompleteCues) {
-            LOG(Media, "InbandMetadataTextTrackPrivateAVF::addDataCue(%p) - updating cue: start=%s, end=%s", this, toString(partialCue.startTime).utf8().data(), toString(time).utf8().data());
-            client()->updateDataCue(this, partialCue.startTime, time, partialCue.cueData);
+        if (client()) {
+            for (auto& partialCue : m_incompleteCues) {
+                LOG(Media, "InbandMetadataTextTrackPrivateAVF::addDataCue(%p) - updating cue: start=%s, end=%s", this, toString(partialCue.startTime).utf8().data(), toString(time).utf8().data());
+                client()->updateDataCue(this, partialCue.startTime, time, partialCue.cueData);
+            }
         }
     } else
         LOG(Media, "InbandMetadataTextTrackPrivateAVF::addDataCue negative length cue(s) ignored: start=%s, end=%s\n", toString(m_currentCueStartTime).utf8().data(), toString(time).utf8().data());