| OLD | NEW |
| 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 629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 640 int32_t gif_decode_extension(gif_decompress_struct_p gif_ptr) { | 640 int32_t gif_decode_extension(gif_decompress_struct_p gif_ptr) { |
| 641 uint8_t* data_size_ptr = NULL; | 641 uint8_t* data_size_ptr = NULL; |
| 642 uint8_t* data_ptr = NULL; | 642 uint8_t* data_ptr = NULL; |
| 643 uint32_t skip_size_org = gif_ptr->skip_size; | 643 uint32_t skip_size_org = gif_ptr->skip_size; |
| 644 switch (gif_ptr->decode_status) { | 644 switch (gif_ptr->decode_status) { |
| 645 case GIF_D_STATUS_EXT_CE: { | 645 case GIF_D_STATUS_EXT_CE: { |
| 646 if (gif_read_data(gif_ptr, &data_size_ptr, 1) == NULL) { | 646 if (gif_read_data(gif_ptr, &data_size_ptr, 1) == NULL) { |
| 647 gif_ptr->skip_size = skip_size_org; | 647 gif_ptr->skip_size = skip_size_org; |
| 648 return 2; | 648 return 2; |
| 649 } | 649 } |
| 650 gif_ptr->cmt_data_ptr->Empty(); | 650 gif_ptr->cmt_data_ptr->clear(); |
| 651 while (*data_size_ptr != GIF_BLOCK_TERMINAL) { | 651 while (*data_size_ptr != GIF_BLOCK_TERMINAL) { |
| 652 uint8_t data_size = *data_size_ptr; | 652 uint8_t data_size = *data_size_ptr; |
| 653 if (gif_read_data(gif_ptr, &data_ptr, *data_size_ptr) == NULL || | 653 if (gif_read_data(gif_ptr, &data_ptr, *data_size_ptr) == NULL || |
| 654 gif_read_data(gif_ptr, &data_size_ptr, 1) == NULL) { | 654 gif_read_data(gif_ptr, &data_size_ptr, 1) == NULL) { |
| 655 gif_ptr->skip_size = skip_size_org; | 655 gif_ptr->skip_size = skip_size_org; |
| 656 return 2; | 656 return 2; |
| 657 } | 657 } |
| 658 *(gif_ptr->cmt_data_ptr) += | 658 *(gif_ptr->cmt_data_ptr) += |
| 659 CFX_ByteString((const FX_CHAR*)data_ptr, data_size); | 659 CFX_ByteString((const FX_CHAR*)data_ptr, data_size); |
| 660 } | 660 } |
| (...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1220 gif_ptr->cur_offset = cur_offset; | 1220 gif_ptr->cur_offset = cur_offset; |
| 1221 res = FALSE; | 1221 res = FALSE; |
| 1222 } | 1222 } |
| 1223 dst_len = gif_ptr->cur_offset; | 1223 dst_len = gif_ptr->cur_offset; |
| 1224 dst_buf[dst_len - 1] = GIF_SIG_TRAILER; | 1224 dst_buf[dst_len - 1] = GIF_SIG_TRAILER; |
| 1225 if (res) { | 1225 if (res) { |
| 1226 gif_ptr->frames++; | 1226 gif_ptr->frames++; |
| 1227 } | 1227 } |
| 1228 return res; | 1228 return res; |
| 1229 } | 1229 } |
| OLD | NEW |