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

Issue 182010: Fix memory leask in media yuv_convert unit tests. Replace pointers init'd by ... (Closed)

Created:
11 years, 3 months ago by jungshik at Google
Modified:
9 years, 7 months ago
Reviewers:
fbarchard
CC:
chromium-reviews_googlegroups.com, fbarchard, Alpha Left Google, awong, Paweł Hajdan Jr., brettw, scherkus (not reviewing)
Visibility:
Public.

Description

Fix memory leask in media yuv_convert unit tests. Replace pointers init'd by plain new[] with scoped_array. BUG=20497 (http://crbug.com/20497) TEST=Valgrind does not report memory leaks any more in media/base/yuv_convert_unittest.cc Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=24735

Patch Set 1 #

Patch Set 2 : '' #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+21 lines, -21 lines) Patch
M media/base/yuv_convert_unittest.cc View 1 3 chunks +21 lines, -21 lines 2 comments Download

Messages

Total messages: 2 (0 generated)
jungshik at Google
11 years, 3 months ago (2009-08-28 15:36:02 UTC) #1
fbarchard
11 years, 3 months ago (2009-08-28 16:56:02 UTC) #2
LGTM!  Good catch

http://codereview.chromium.org/182010/diff/2001/3001
File media/base/yuv_convert_unittest.cc (right):

http://codereview.chromium.org/182010/diff/2001/3001#newcode142
Line 142: scoped_array<uint8> yuv_bytes(new uint8[size_of_yuv]);
doh!  How quaint.  This was the first unit test I wrote at google.
Good catch
But, I based it directly on one ralphl wrote, so you'll find at least one more
just like this.
My audio_util one may be similar and needs a check, but I think I'm using
scoped_pointers everywhere.

http://codereview.chromium.org/182010/diff/2001/3001#newcode154
Line 154: yuv_bytes.get() + kWidth * kHeight * 5 / 4,  // V
kinda silly that 80 columns forces tiny comments, but this is still readable.

Powered by Google App Engine
This is Rietveld 408576698