diff options
author | abetul@google.com <abetul@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-09 17:49:16 +0000 |
---|---|---|
committer | abetul@google.com <abetul@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-09 17:49:16 +0000 |
commit | 51b623da27ffd93a28b03377d43a407f7811d292 (patch) | |
tree | 9c1ba0d469198a4182bd88200e95b2b7b3d1ef64 | |
parent | 1434d76f5422d81028255e538570adbf1f222548 (diff) | |
download | chromium_src-51b623da27ffd93a28b03377d43a407f7811d292.zip chromium_src-51b623da27ffd93a28b03377d43a407f7811d292.tar.gz chromium_src-51b623da27ffd93a28b03377d43a407f7811d292.tar.bz2 |
fixing bug in 2D context painted area pixel count computation
TEST=none
BUG=none
Review URL: http://codereview.chromium.org/1611011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44103 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/renderer/webplugin_delegate_pepper.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/chrome/renderer/webplugin_delegate_pepper.cc b/chrome/renderer/webplugin_delegate_pepper.cc index 9c4db6c..46ef954 100644 --- a/chrome/renderer/webplugin_delegate_pepper.cc +++ b/chrome/renderer/webplugin_delegate_pepper.cc @@ -480,9 +480,11 @@ NPError WebPluginDelegatePepper::Device2DGetStateContext( } else if (state == NPExtensionsReservedStateSharedMemoryChecksum) { if (!context) return NPERR_INVALID_PARAM; - int32 row_count = context->dirty.bottom - context->dirty.top + 1; - int32 stride = context->dirty.right - context->dirty.left + 1; - size_t length = row_count * stride * sizeof(uint32); + // Bytes per pixel. + static const int kBytesPixel = 4; + int32 row_count = context->dirty.bottom - context->dirty.top; + int32 stride = context->dirty.right - context->dirty.left; + size_t length = row_count * stride * kBytesPixel; MD5Digest md5_result; // 128-bit digest MD5Sum(context->region, length, &md5_result); std::string hex_md5 = MD5DigestToBase16(md5_result); |