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

Unified Diff: media/base/yuv_convert.cc

Issue 149463010: Fix valgrind warnings in YUV scaling code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | tools/valgrind/drmemory/suppressions_full.txt » ('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 9dc05596e288268c51024d4d4a2de254452edc57..2b27c1da4a9a717160e6640f84ac77c95d8bb2b4 100644
--- a/media/base/yuv_convert.cc
+++ b/media/base/yuv_convert.cc
@@ -20,6 +20,7 @@
#include "base/cpu.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
+#include "base/third_party/dynamic_annotations/dynamic_annotations.h"
#include "build/build_config.h"
#include "media/base/simd/convert_rgb_to_yuv.h"
#include "media/base/simd/convert_yuv_to_rgb.h"
@@ -444,6 +445,9 @@ void ScaleYUVToRGB32WithRect(const uint8* y_buf,
const int kFilterBufferSize = 4096;
const bool kAvoidUsingOptimizedFilter = source_width > kFilterBufferSize;
uint8 yuv_temp[16 + kFilterBufferSize * 3 + 16];
+ // memset() yuv_temp to 0 to avoid bogus warnings when running on Valgrind.
+ if (RunningOnValgrind())
+ memset(yuv_temp, 0, sizeof(yuv_temp));
uint8* y_temp = reinterpret_cast<uint8*>(
reinterpret_cast<uintptr_t>(yuv_temp + 15) & ~15);
uint8* u_temp = y_temp + kFilterBufferSize;
« no previous file with comments | « no previous file | tools/valgrind/drmemory/suppressions_full.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698