summaryrefslogtreecommitdiffstats
path: root/base/clipboard_util.cc
diff options
context:
space:
mode:
authortc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-16 05:28:09 +0000
committertc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-16 05:28:09 +0000
commitf2e376defc693600c29f6ff37f57bb91ce6ec1c0 (patch)
tree8e26a28b61f20516fb5d2b577f1a3a7f1bda2691 /base/clipboard_util.cc
parent1a0cdee94dc433f4f3fb09c6585232be739b17c0 (diff)
downloadchromium_src-f2e376defc693600c29f6ff37f57bb91ce6ec1c0.zip
chromium_src-f2e376defc693600c29f6ff37f57bb91ce6ec1c0.tar.gz
chromium_src-f2e376defc693600c29f6ff37f57bb91ce6ec1c0.tar.bz2
Fix a bug where we were truncating the last byte of images
dragged from web content. This was caused by using the wrong helper method to create the storage in os_exchange_data. The method GetStorageForString adds an extra null byte to the data that we were removing at the wrong place in the code. BUG=http://crbug.com/2414 TEST=unit_tests still pass; drag an image from a web page and open it in photoshop Review URL: http://codereview.chromium.org/7372 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3452 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/clipboard_util.cc')
-rw-r--r--base/clipboard_util.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/base/clipboard_util.cc b/base/clipboard_util.cc
index 5902b43..9d35db4 100644
--- a/base/clipboard_util.cc
+++ b/base/clipboard_util.cc
@@ -356,8 +356,7 @@ bool ClipboardUtil::GetFileContents(IDataObject* data_object,
if (SUCCEEDED(data_object->GetData(GetFileContentFormatZero(), &content))) {
if (TYMED_HGLOBAL == content.tymed) {
ScopedHGlobal<char> data(content.hGlobal);
- // The size includes the trailing NULL byte. We don't want it.
- file_contents->assign(data.get(), data.Size() - 1);
+ file_contents->assign(data.get(), data.Size());
}
ReleaseStgMedium(&content);
}