Get the size from the shared buffer.
authorandersca <andersca@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Mar 2007 17:38:51 +0000 (17:38 +0000)
committerandersca <andersca@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Mar 2007 17:38:51 +0000 (17:38 +0000)
        * platform/graphics/cg/ImageSourceCG.cpp:
        (WebCore::ImageSource::setData):
        * platform/graphics/cg/PDFDocumentImage.cpp:
        (WebCore::PDFDocumentImage::dataChanged):

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

WebCore/ChangeLog
WebCore/platform/graphics/cg/ImageSourceCG.cpp
WebCore/platform/graphics/cg/PDFDocumentImage.cpp

index 109660f..8e48a10 100644 (file)
@@ -1,3 +1,12 @@
+2007-03-14  Administrator  <acarlsson@apple.com>
+
+        Get the size from the shared buffer.
+        
+        * platform/graphics/cg/ImageSourceCG.cpp:
+        (WebCore::ImageSource::setData):
+        * platform/graphics/cg/PDFDocumentImage.cpp:
+        (WebCore::PDFDocumentImage::dataChanged):
+
 2007-03-14  Mitz Pettel  <mitz@webkit.org>
 
         Reviewed by Hyatt, thumbs up by Darin.
index fc854fb..a8eaee4 100644 (file)
@@ -83,7 +83,7 @@ void ImageSource::setData(SharedBuffer* data, bool allDataReceived)
 #else
     // If no NSData is available, then we know SharedBuffer will always just be a vector.  That means no secret changes can occur to it behind the
     // scenes.  We use CFDataCreateWithBytesNoCopy in that case.
-    CFDataRef cfData = CFDataCreateWithBytesNoCopy(0, reinterpret_cast<const UInt8*>(data->data()), length, kCFAllocatorNull);
+    CFDataRef cfData = CFDataCreateWithBytesNoCopy(0, reinterpret_cast<const UInt8*>(data->data()), data->size(), kCFAllocatorNull);
 #endif
     CGImageSourceUpdateData(m_decoder, cfData, allDataReceived);
     CFRelease(cfData);
index a797ac8..ec98703 100644 (file)
@@ -63,7 +63,7 @@ bool PDFDocumentImage::dataChanged(bool allDataReceived)
 #else
         // If no NSData is available, then we know SharedBuffer will always just be a vector.  That means no secret changes can occur to it behind the
         // scenes.  We use CFDataCreateWithBytesNoCopy in that case.
-        CFDataRef data = CFDataCreateWithBytesNoCopy(0, reinterpret_cast<const UInt8*>(m_data->data()), length, kCFAllocatorNull);
+        CFDataRef data = CFDataCreateWithBytesNoCopy(0, reinterpret_cast<const UInt8*>(m_data->data()), m_data->size(), kCFAllocatorNull);
 #endif
         CGDataProviderRef dataProvider = CGDataProviderCreateWithCFData(data);
         CFRelease(data);