summaryrefslogtreecommitdiffstats
path: root/media/base
diff options
context:
space:
mode:
authoralexeypa@chromium.org <alexeypa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-09 19:00:51 +0000
committeralexeypa@chromium.org <alexeypa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-09 19:00:51 +0000
commitb3ca1f55f4a1f0dd84c72e99e60a971cebe33b1f (patch)
tree5602448fb7a33a0d19f570f49a7cba13a6275b7c /media/base
parentbe2394928af63719c56cd97fb2725ab4123e10ce (diff)
downloadchromium_src-b3ca1f55f4a1f0dd84c72e99e60a971cebe33b1f.zip
chromium_src-b3ca1f55f4a1f0dd84c72e99e60a971cebe33b1f.tar.gz
chromium_src-b3ca1f55f4a1f0dd84c72e99e60a971cebe33b1f.tar.bz2
Introducing helper wrappers for copying a rectangle from a one partial buffer to another. YUV to RGB and RGB to RGB operations are supported. YUV to RGB allows down-scaling of re
This CL also adds a supression for Valgrind which otherwise falsely complains about accessing uninitialized memory. See 113076 for details. BUG=109938,113076 TEST=remoting_unittests.Yuv2Rgb Review URL: http://codereview.chromium.org/9371002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@121258 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/base')
-rw-r--r--media/base/yuv_convert.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/media/base/yuv_convert.cc b/media/base/yuv_convert.cc
index 8d5073b..ed9bed4 100644
--- a/media/base/yuv_convert.cc
+++ b/media/base/yuv_convert.cc
@@ -335,8 +335,9 @@ void ScaleYUVToRGB32WithRect(const uint8* y_buf,
// Determine the parts of the Y, U and V buffers to interpolate.
int source_y_left = source_left >> kFractionBits;
- int source_y_right = (source_right >> kFractionBits) + 2;
- DCHECK(source_y_right <= source_width);
+ int source_y_right = std::min(
+ (source_right >> kFractionBits) + 2,
+ source_width + 1);
int source_uv_left = source_y_left / 2;
int source_uv_right = std::min(