Title: [223896] trunk/Source/WebCore
Revision
223896
Author
[email protected]
Date
2017-10-24 10:32:11 -0700 (Tue, 24 Oct 2017)

Log Message

RenderThemeCocoa::mediaControlsFormattedStringForDuration may cause a crash due to unhandled Obj-C exception
https://bugs.webkit.org/show_bug.cgi?id=178716
<rdar://problem/35112900>

Patch by Antoine Quint <[email protected]> on 2017-10-24
Reviewed by Dean Jackson.

* rendering/RenderThemeCocoa.mm:
(WebCore::RenderThemeCocoa::mediaControlsFormattedStringForDuration):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (223895 => 223896)


--- trunk/Source/WebCore/ChangeLog	2017-10-24 17:24:40 UTC (rev 223895)
+++ trunk/Source/WebCore/ChangeLog	2017-10-24 17:32:11 UTC (rev 223896)
@@ -1,3 +1,14 @@
+2017-10-24  Antoine Quint  <[email protected]>
+
+        RenderThemeCocoa::mediaControlsFormattedStringForDuration may cause a crash due to unhandled Obj-C exception
+        https://bugs.webkit.org/show_bug.cgi?id=178716
+        <rdar://problem/35112900>
+
+        Reviewed by Dean Jackson.
+
+        * rendering/RenderThemeCocoa.mm:
+        (WebCore::RenderThemeCocoa::mediaControlsFormattedStringForDuration):
+
 2017-10-24  Ryosuke Niwa  <[email protected]>
 
         SizesAttributeParser::SizesAttributeParser triggers layout

Modified: trunk/Source/WebCore/rendering/RenderThemeCocoa.mm (223895 => 223896)


--- trunk/Source/WebCore/rendering/RenderThemeCocoa.mm	2017-10-24 17:24:40 UTC (rev 223895)
+++ trunk/Source/WebCore/rendering/RenderThemeCocoa.mm	2017-10-24 17:32:11 UTC (rev 223896)
@@ -46,6 +46,7 @@
 
 #if ENABLE(VIDEO)
 #include "LocalizedStrings.h"
+#include <wtf/BlockObjCExceptions.h>
 #endif
 
 namespace WebCore {
@@ -117,6 +118,7 @@
     if (!std::isfinite(durationInSeconds))
         return WEB_UI_STRING("indefinite time", "accessibility help text for an indefinite media controller time value");
 
+    BEGIN_BLOCK_OBJC_EXCEPTIONS;
     if (!m_durationFormatter) {
         m_durationFormatter = adoptNS([NSDateComponentsFormatter new]);
         m_durationFormatter.get().unitsStyle = NSDateComponentsFormatterUnitsStyleFull;
@@ -125,6 +127,7 @@
         m_durationFormatter.get().maximumUnitCount = 2;
     }
     return [m_durationFormatter.get() stringFromTimeInterval:durationInSeconds];
+    END_BLOCK_OBJC_EXCEPTIONS;
 #else
     return emptyString();
 #endif
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to