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

Side by Side Diff: core/fxcodec/lgif/fx_gif.cpp

Issue 2291143003: Free the GifPlainText object when complete. (Closed)
Patch Set: Created 4 years, 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | 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 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "core/fxcodec/lgif/fx_gif.h" 7 #include "core/fxcodec/lgif/fx_gif.h"
8 8
9 #include "core/fxcodec/lbmp/fx_bmp.h" 9 #include "core/fxcodec/lbmp/fx_bmp.h"
10 10
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 } 411 }
412 delete gif_ptr->cmt_data_ptr; 412 delete gif_ptr->cmt_data_ptr;
413 FX_Free(gif_ptr->gce_ptr); 413 FX_Free(gif_ptr->gce_ptr);
414 if (gif_ptr->pt_ptr_arr_ptr) { 414 if (gif_ptr->pt_ptr_arr_ptr) {
415 int32_t size_pt_arr = gif_ptr->pt_ptr_arr_ptr->GetSize(); 415 int32_t size_pt_arr = gif_ptr->pt_ptr_arr_ptr->GetSize();
416 for (int32_t i = 0; i < size_pt_arr; i++) { 416 for (int32_t i = 0; i < size_pt_arr; i++) {
417 GifPlainText* p = gif_ptr->pt_ptr_arr_ptr->GetAt(i); 417 GifPlainText* p = gif_ptr->pt_ptr_arr_ptr->GetAt(i);
418 FX_Free(p->gce_ptr); 418 FX_Free(p->gce_ptr);
419 FX_Free(p->pte_ptr); 419 FX_Free(p->pte_ptr);
420 delete p->string_ptr; 420 delete p->string_ptr;
421 FX_Free(p);
421 } 422 }
422 gif_ptr->pt_ptr_arr_ptr->RemoveAll(); 423 gif_ptr->pt_ptr_arr_ptr->RemoveAll();
423 delete gif_ptr->pt_ptr_arr_ptr; 424 delete gif_ptr->pt_ptr_arr_ptr;
424 } 425 }
425 FX_Free(gif_ptr); 426 FX_Free(gif_ptr);
426 } 427 }
427 gif_compress_struct_p gif_create_compress() { 428 gif_compress_struct_p gif_create_compress() {
428 gif_compress_struct_p gif_ptr = 429 gif_compress_struct_p gif_ptr =
429 (gif_compress_struct*)FX_Alloc(uint8_t, sizeof(gif_compress_struct)); 430 (gif_compress_struct*)FX_Alloc(uint8_t, sizeof(gif_compress_struct));
430 if (!gif_ptr) 431 if (!gif_ptr)
(...skipping 805 matching lines...) Expand 10 before | Expand all | Expand 10 after
1236 gif_ptr->cur_offset = cur_offset; 1237 gif_ptr->cur_offset = cur_offset;
1237 res = FALSE; 1238 res = FALSE;
1238 } 1239 }
1239 dst_len = gif_ptr->cur_offset; 1240 dst_len = gif_ptr->cur_offset;
1240 dst_buf[dst_len - 1] = GIF_SIG_TRAILER; 1241 dst_buf[dst_len - 1] = GIF_SIG_TRAILER;
1241 if (res) { 1242 if (res) {
1242 gif_ptr->frames++; 1243 gif_ptr->frames++;
1243 } 1244 }
1244 return res; 1245 return res;
1245 } 1246 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698