Title: [89172] trunk/Source/WebCore
Revision
89172
Author
[email protected]
Date
2011-06-17 14:20:44 -0700 (Fri, 17 Jun 2011)

Log Message

2011-06-17  Jer Noble  <[email protected]>

        Reviewed by Ada Chan.

        Playing video from the manifest crashes on Windows
        https://bugs.webkit.org/show_bug.cgi?id=62901

        No new tests. This will be covered by existing App Cache tests.

        Two related fixes.  1) Null-check the CFStringRef and CFURLRef created in QTMovie::load() before
        passing them to CFRelease().  2) Use CFURL to create an appropriate file-URL on windows in
        createFileURLForApplicationCacheResource.

        * html/HTMLMediaElement.cpp:
        (WebCore::createFileURLForApplicationCacheResource):
        * platform/graphics/win/QTMovie.cpp:
        (QTMovie::load):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (89171 => 89172)


--- trunk/Source/WebCore/ChangeLog	2011-06-17 20:52:15 UTC (rev 89171)
+++ trunk/Source/WebCore/ChangeLog	2011-06-17 21:20:44 UTC (rev 89172)
@@ -1,3 +1,21 @@
+2011-06-17  Jer Noble  <[email protected]>
+
+        Reviewed by Ada Chan.
+
+        Playing video from the manifest crashes on Windows
+        https://bugs.webkit.org/show_bug.cgi?id=62901
+
+        No new tests. This will be covered by existing App Cache tests.
+
+        Two related fixes.  1) Null-check the CFStringRef and CFURLRef created in QTMovie::load() before
+        passing them to CFRelease().  2) Use CFURL to create an appropriate file-URL on windows in 
+        createFileURLForApplicationCacheResource.
+
+        * html/HTMLMediaElement.cpp:
+        (WebCore::createFileURLForApplicationCacheResource):
+        * platform/graphics/win/QTMovie.cpp:
+        (QTMovie::load):
+
 2011-06-17  Abhishek Arya  <[email protected]>
 
         Reviewed by Dave Hyatt.

Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (89171 => 89172)


--- trunk/Source/WebCore/html/HTMLMediaElement.cpp	2011-06-17 20:52:15 UTC (rev 89171)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp	2011-06-17 21:20:44 UTC (rev 89172)
@@ -681,10 +681,17 @@
     // is not suitable because KURL::setPath uses encodeWithURLEscapeSequences, which it notes
     // does not correctly escape '#' and '?'. This function works for our purposes because
     // app cache media files are always created with encodeForFileName(createCanonicalUUIDString()).
+
+#if USE(CF) && PLATFORM(WIN)
+    RetainPtr<CFStringRef> cfPath(AdoptCF, path.createCFString());
+    RetainPtr<CFURLRef> cfURL(AdoptCF, CFURLCreateWithFileSystemPath(0, cfPath.get(), kCFURLWindowsPathStyle, false));
+    KURL url(cfURL.get());
+#else
     KURL url;
 
     url.setProtocol("file");
     url.setPath(path);
+#endif
     return url;
 }
 #endif

Modified: trunk/Source/WebCore/platform/graphics/win/QTMovie.cpp (89171 => 89172)


--- trunk/Source/WebCore/platform/graphics/win/QTMovie.cpp	2011-06-17 20:52:15 UTC (rev 89171)
+++ trunk/Source/WebCore/platform/graphics/win/QTMovie.cpp	2011-06-17 21:20:44 UTC (rev 89172)
@@ -449,8 +449,10 @@
 
     load(cfURL, preservesPitch);
 
-    CFRelease(cfURL);
-    CFRelease(urlStringRef);
+    if (cfURL)
+        CFRelease(cfURL);
+    if (urlStringRef)
+        CFRelease(urlStringRef);
 }
 
 void QTMovie::load(const UChar* url, int len, bool preservesPitch)
@@ -460,8 +462,10 @@
 
     load(cfURL, preservesPitch);
 
-    CFRelease(cfURL);
-    CFRelease(urlStringRef);
+    if (cfURL)
+        CFRelease(cfURL);
+    if (urlStringRef)
+        CFRelease(urlStringRef);
 }
 
 void QTMovie::load(CFURLRef url, bool preservesPitch)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to