Get the size from the shared buffer.
[WebKit-https.git] / WebCore / platform / graphics / cg / ImageSourceCG.cpp
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);