From 2c4104443f5a7aea225bd853770cdc11ab431932 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Wed, 6 May 2015 15:09:06 -0700 Subject: Merge to XFA: Replace FX_NEW with new, remote tests from fxcodec Review URL: https://codereview.chromium.org/1084303002 (cherry picked from commit cfc1a654ef3e8b65bc447815d35932c185bf1422) R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1125363002 --- core/src/fxcodec/lgif/fx_gif.cpp | 31 ++++++------------------------- 1 file changed, 6 insertions(+), 25 deletions(-) (limited to 'core/src/fxcodec/lgif') diff --git a/core/src/fxcodec/lgif/fx_gif.cpp b/core/src/fxcodec/lgif/fx_gif.cpp index 8f5794e786..08c1803e8a 100644 --- a/core/src/fxcodec/lgif/fx_gif.cpp +++ b/core/src/fxcodec/lgif/fx_gif.cpp @@ -342,27 +342,12 @@ gif_decompress_struct_p _gif_create_decompress() } FXSYS_memset32(gif_ptr, 0, sizeof(gif_decompress_struct)); gif_ptr->decode_status = GIF_D_STATUS_SIG; - gif_ptr->img_ptr_arr_ptr = FX_NEW CFX_ArrayTemplate; - if(gif_ptr->img_ptr_arr_ptr == NULL) { - FX_Free(gif_ptr); - return NULL; - } + gif_ptr->img_ptr_arr_ptr = new CFX_ArrayTemplate; #ifdef GIF_SUPPORT_COMMENT_EXTENSION - gif_ptr->cmt_data_ptr = FX_NEW CFX_ByteString; - if(gif_ptr->cmt_data_ptr == NULL) { - delete gif_ptr->img_ptr_arr_ptr; - FX_Free(gif_ptr); - return NULL; - } + gif_ptr->cmt_data_ptr = new CFX_ByteString; #endif #ifdef GIF_SUPPORT_PLAIN_TEXT_EXTENSION - gif_ptr->pt_ptr_arr_ptr = FX_NEW CFX_ArrayTemplate; - if(gif_ptr->pt_ptr_arr_ptr == NULL) { - delete(gif_ptr->cmt_data_ptr); - delete gif_ptr->img_ptr_arr_ptr; - FX_Free(gif_ptr); - return NULL; - } + gif_ptr->pt_ptr_arr_ptr = new CFX_ArrayTemplate; #endif return gif_ptr; } @@ -443,11 +428,7 @@ gif_compress_struct_p _gif_create_compress() return NULL; } FXSYS_memset32(gif_ptr, 0, sizeof(gif_compress_struct)); - gif_ptr->img_encoder_ptr = FX_NEW CGifLZWEncoder; - if (gif_ptr->img_encoder_ptr == NULL) { - FX_Free(gif_ptr); - return NULL; - } + gif_ptr->img_encoder_ptr = new CGifLZWEncoder; gif_ptr->header_ptr = (GifHeader*)FX_Alloc(FX_BYTE, sizeof(GifHeader)); if (gif_ptr->header_ptr == NULL) { delete(gif_ptr->img_encoder_ptr); @@ -800,7 +781,7 @@ FX_INT32 _gif_decode_extension(gif_decompress_struct_p gif_ptr) _gif_takeover_gce_ptr(gif_ptr, &gif_pt_ptr->gce_ptr); gif_pt_ptr->pte_ptr = (GifPTE*)FX_Alloc(FX_BYTE, sizeof(GifPTE)); GIF_PTR_NOT_NULL(gif_pt_ptr->pte_ptr, gif_ptr); - gif_pt_ptr->string_ptr = FX_NEW CFX_ByteString; + gif_pt_ptr->string_ptr = new CFX_ByteString; GIF_PTR_NOT_NULL(gif_pt_ptr->string_ptr, gif_ptr); gif_pt_ptr->pte_ptr->block_size = gif_pte_ptr->block_size; gif_pt_ptr->pte_ptr->grid_left = _GetWord_LSBFirst((FX_LPBYTE)&gif_pte_ptr->grid_left); @@ -1036,7 +1017,7 @@ FX_INT32 _gif_load_frame(gif_decompress_struct_p gif_ptr, FX_INT32 frame_num) } } if(gif_ptr->img_decoder_ptr == NULL) { - gif_ptr->img_decoder_ptr = FX_NEW CGifLZWDecoder(gif_ptr->err_ptr); + gif_ptr->img_decoder_ptr = new CGifLZWDecoder(gif_ptr->err_ptr); GIF_PTR_NOT_NULL(gif_ptr->img_decoder_ptr, gif_ptr); } gif_ptr->img_decoder_ptr->InitTable(gif_image_ptr->image_code_size); -- cgit v1.2.3