[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

kocienda kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 05:59:27 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit f0ca54c21f1c7ff46d16926bc1c7c70819c85594
Author: kocienda <kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Mar 29 16:51:06 2002 +0000

    2002-03-29  Kenneth Kocienda  <kocienda at apple.com>
    
            Workaround for Radar 2890624 (Double free of image data in QPixmap)
            This hack is necessary for the app to run on some Jaguar system. Otherwise
            images that the GIF library cannot decode will cause a crash.
    
            * src/kwq/KWQPixmap.mm: (QPixmap::QPixmap):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@888 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index 09418ce..fbe9abf 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,11 @@
+2002-03-29  Kenneth Kocienda  <kocienda at apple.com>
+
+        Workaround for Radar 2890624 (Double free of image data in QPixmap)
+        This hack is necessary for the app to run on some Jaguar system. Otherwise
+        images that the GIF library cannot decode will cause a crash.
+        
+	* src/kwq/KWQPixmap.mm: (QPixmap::QPixmap):
+
 2002-03-28  Richard Williamson  <rjw at apple.com>
 
         Fixed basic font horkage caused by removal of KDE font matching code.  We
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 09418ce..fbe9abf 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,11 @@
+2002-03-29  Kenneth Kocienda  <kocienda at apple.com>
+
+        Workaround for Radar 2890624 (Double free of image data in QPixmap)
+        This hack is necessary for the app to run on some Jaguar system. Otherwise
+        images that the GIF library cannot decode will cause a crash.
+        
+	* src/kwq/KWQPixmap.mm: (QPixmap::QPixmap):
+
 2002-03-28  Richard Williamson  <rjw at apple.com>
 
         Fixed basic font horkage caused by removal of KDE font matching code.  We
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 09418ce..fbe9abf 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,11 @@
+2002-03-29  Kenneth Kocienda  <kocienda at apple.com>
+
+        Workaround for Radar 2890624 (Double free of image data in QPixmap)
+        This hack is necessary for the app to run on some Jaguar system. Otherwise
+        images that the GIF library cannot decode will cause a crash.
+        
+	* src/kwq/KWQPixmap.mm: (QPixmap::QPixmap):
+
 2002-03-28  Richard Williamson  <rjw at apple.com>
 
         Fixed basic font horkage caused by removal of KDE font matching code.  We
diff --git a/WebCore/kwq/KWQPixmap.mm b/WebCore/kwq/KWQPixmap.mm
index 8d66700..e0a1a9d 100644
--- a/WebCore/kwq/KWQPixmap.mm
+++ b/WebCore/kwq/KWQPixmap.mm
@@ -64,16 +64,32 @@ QPixmap::QPixmap(const QByteArray&bytes)
      * Here we're using private API to get around the problem 
      * of image bytes being double freed.
      */
-    //NSData *nsdata = [[[NSData alloc] initWithBytesNoCopy: bytes.data() length: bytes.size()] autorelease];
-    NSData *nsdata = [[[NSData alloc] initWithBytes: bytes.data() length: bytes.size() copy:NO freeWhenDone:NO bytesAreVM:NO] autorelease];
+    NSData *nsdata = [[NSData alloc] initWithBytes: bytes.data() length: bytes.size() copy:NO freeWhenDone:NO bytesAreVM:NO];
     nsimage = [[NSImage alloc] initWithData: nsdata];
+    // FIXME: Workaround for Radar 2890624 (Double free of image data in QPixmap)
+    // This else if code block should be removed when we pick up changes from AppKit
+    // image code that are on HEAD now, but are not in Jaguar <= 6B63
+    // When we pick up the change from AppKit, uncomment the next line and release the data here
+    //[nsdata release];
     if (nsimage == nil){
         KWQDEBUG("unable to create image\n");
-    } else {
+        // FIXME: delete next line when Radar 2890624
+        [nsdata release];
+    } 
+    else if ([[nsimage representations] count] == 0) {
+        KWQDEBUG("unable to create image [can't decode bytes]\n");
+        // leak the ns image pointer
+        // note that the data is freed erroneously by AppKit
+        // we're not leaking that, just the nsimage pointer
+        nsimage = nil;
+    }
+    else {
         KWQDEBUG("image created\n");
+        // FIXME: delete next line when Radar 2890624
+        [nsdata release];
+        [nsimage setFlipped: YES];
+        [nsimage setScalesWhenResized: YES];
     }
-    [nsimage setFlipped: YES];
-    [nsimage setScalesWhenResized: YES];
 }
 
 
diff --git a/WebCore/src/kwq/KWQPixmap.mm b/WebCore/src/kwq/KWQPixmap.mm
index 8d66700..e0a1a9d 100644
--- a/WebCore/src/kwq/KWQPixmap.mm
+++ b/WebCore/src/kwq/KWQPixmap.mm
@@ -64,16 +64,32 @@ QPixmap::QPixmap(const QByteArray&bytes)
      * Here we're using private API to get around the problem 
      * of image bytes being double freed.
      */
-    //NSData *nsdata = [[[NSData alloc] initWithBytesNoCopy: bytes.data() length: bytes.size()] autorelease];
-    NSData *nsdata = [[[NSData alloc] initWithBytes: bytes.data() length: bytes.size() copy:NO freeWhenDone:NO bytesAreVM:NO] autorelease];
+    NSData *nsdata = [[NSData alloc] initWithBytes: bytes.data() length: bytes.size() copy:NO freeWhenDone:NO bytesAreVM:NO];
     nsimage = [[NSImage alloc] initWithData: nsdata];
+    // FIXME: Workaround for Radar 2890624 (Double free of image data in QPixmap)
+    // This else if code block should be removed when we pick up changes from AppKit
+    // image code that are on HEAD now, but are not in Jaguar <= 6B63
+    // When we pick up the change from AppKit, uncomment the next line and release the data here
+    //[nsdata release];
     if (nsimage == nil){
         KWQDEBUG("unable to create image\n");
-    } else {
+        // FIXME: delete next line when Radar 2890624
+        [nsdata release];
+    } 
+    else if ([[nsimage representations] count] == 0) {
+        KWQDEBUG("unable to create image [can't decode bytes]\n");
+        // leak the ns image pointer
+        // note that the data is freed erroneously by AppKit
+        // we're not leaking that, just the nsimage pointer
+        nsimage = nil;
+    }
+    else {
         KWQDEBUG("image created\n");
+        // FIXME: delete next line when Radar 2890624
+        [nsdata release];
+        [nsimage setFlipped: YES];
+        [nsimage setScalesWhenResized: YES];
     }
-    [nsimage setFlipped: YES];
-    [nsimage setScalesWhenResized: YES];
 }
 
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list