Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(865)

Unified Diff: media/base/yuv_convert.cc

Issue 9320025: Introducing a helper wrapper for YUV-to-RGB convertion and/or scaling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More review feedback. Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | remoting/base/decoder_vp8.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/yuv_convert.cc
diff --git a/media/base/yuv_convert.cc b/media/base/yuv_convert.cc
index 8d5073bfc2bc25d4fe47181e82ff0cc085985b55..ed9bed4cc87e0c9a5bfba43171b3aa606fcdfd9b 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(
« no previous file with comments | « no previous file | remoting/base/decoder_vp8.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698