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

Side by Side Diff: core/src/fxcodec/codec/fx_codec_jpx_unittest.cpp

Issue 1467183006: Fix two memory leaks from pdfium_unittests (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years 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 unified diff | Download patch
« no previous file with comments | « core/src/fpdfapi/fpdf_parser/fpdf_parser_decode_unittest.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stdint.h> 5 #include <stdint.h>
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "codec_int.h" 9 #include "codec_int.h"
10 #include "testing/fx_string_testhelpers.h" 10 #include "testing/fx_string_testhelpers.h"
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 467
468 TEST(fxcodec, YUV420ToRGB) { 468 TEST(fxcodec, YUV420ToRGB) {
469 opj_image_comp_t u; 469 opj_image_comp_t u;
470 memset(&u, 0, sizeof(u)); 470 memset(&u, 0, sizeof(u));
471 u.dx = 1; 471 u.dx = 1;
472 u.dy = 1; 472 u.dy = 1;
473 u.w = 16; 473 u.w = 16;
474 u.h = 16; 474 u.h = 16;
475 u.prec = 8; 475 u.prec = 8;
476 u.bpp = 8; 476 u.bpp = 8;
477 u.data = FX_Alloc(OPJ_INT32, u.w * u.h);
478 memset(u.data, 0, u.w * u.h * sizeof(OPJ_INT32));
479 opj_image_comp_t v; 477 opj_image_comp_t v;
480 memset(&v, 0, sizeof(v)); 478 memset(&v, 0, sizeof(v));
481 v.dx = 1; 479 v.dx = 1;
482 v.dy = 1; 480 v.dy = 1;
483 v.w = 16; 481 v.w = 16;
484 v.h = 16; 482 v.h = 16;
485 v.prec = 8; 483 v.prec = 8;
486 v.bpp = 8; 484 v.bpp = 8;
487 v.data = FX_Alloc(OPJ_INT32, v.w * v.h);
488 memset(v.data, 0, v.w * v.h * sizeof(OPJ_INT32));
489 opj_image_comp_t y; 485 opj_image_comp_t y;
490 memset(&y, 0, sizeof(y)); 486 memset(&y, 0, sizeof(y));
491 y.dx = 1; 487 y.dx = 1;
492 y.dy = 1; 488 y.dy = 1;
493 y.prec = 8; 489 y.prec = 8;
494 y.bpp = 8; 490 y.bpp = 8;
495 opj_image_t img; 491 opj_image_t img;
496 memset(&img, 0, sizeof(img)); 492 memset(&img, 0, sizeof(img));
497 img.numcomps = 3; 493 img.numcomps = 3;
498 img.color_space = OPJ_CLRSPC_SYCC; 494 img.color_space = OPJ_CLRSPC_SYCC;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 EXPECT_NE(img.comps[0].h, img.comps[1].h); 529 EXPECT_NE(img.comps[0].h, img.comps[1].h);
534 EXPECT_NE(img.comps[0].w, img.comps[2].w); 530 EXPECT_NE(img.comps[0].w, img.comps[2].w);
535 EXPECT_NE(img.comps[0].h, img.comps[2].h); 531 EXPECT_NE(img.comps[0].h, img.comps[2].h);
536 } 532 }
537 FX_Free(img.comps[0].data); 533 FX_Free(img.comps[0].data);
538 FX_Free(img.comps[1].data); 534 FX_Free(img.comps[1].data);
539 FX_Free(img.comps[2].data); 535 FX_Free(img.comps[2].data);
540 } 536 }
541 FX_Free(img.comps); 537 FX_Free(img.comps);
542 } 538 }
OLDNEW
« no previous file with comments | « core/src/fpdfapi/fpdf_parser/fpdf_parser_decode_unittest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698