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

Side by Side Diff: core/fxcodec/codec/fx_codec_png.cpp

Issue 2036203004: Fix some code which causes warnings when compiled by /analyze tool (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 6 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
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 <algorithm> 7 #include <algorithm>
8 8
9 #include "core/fxcodec/codec/codec_int.h" 9 #include "core/fxcodec/codec/codec_int.h"
10 #include "core/fxcodec/include/fx_codec.h" 10 #include "core/fxcodec/include/fx_codec.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 png_get_iCCP(png_ptr, info_ptr, &icc_name, &compress_type, &icc_profile, 49 png_get_iCCP(png_ptr, info_ptr, &icc_name, &compress_type, &icc_profile,
50 &icc_proflen); 50 &icc_proflen);
51 #endif 51 #endif
52 int bTime = 0; 52 int bTime = 0;
53 #if defined(PNG_tIME_SUPPORTED) 53 #if defined(PNG_tIME_SUPPORTED)
54 png_timep t = NULL; 54 png_timep t = NULL;
55 png_get_tIME(png_ptr, info_ptr, &t); 55 png_get_tIME(png_ptr, info_ptr, &t);
56 if (t) { 56 if (t) {
57 FXSYS_memset(pAttribute->m_strTime, 0, sizeof(pAttribute->m_strTime)); 57 FXSYS_memset(pAttribute->m_strTime, 0, sizeof(pAttribute->m_strTime));
58 FXSYS_snprintf((FX_CHAR*)pAttribute->m_strTime, 58 FXSYS_snprintf((FX_CHAR*)pAttribute->m_strTime,
59 sizeof(pAttribute->m_strTime), "%4d:%2d:%2d %2d:%2d:%2d", 59 sizeof(pAttribute->m_strTime), "%4u:%2u:%2u %2u:%2u:%2u",
60 t->year, t->month, t->day, t->hour, t->minute, t->second); 60 t->year, t->month, t->day, t->hour, t->minute, t->second);
61 pAttribute->m_strTime[sizeof(pAttribute->m_strTime) - 1] = 0; 61 pAttribute->m_strTime[sizeof(pAttribute->m_strTime) - 1] = 0;
62 bTime = 1; 62 bTime = 1;
63 } 63 }
64 #endif 64 #endif
65 #if defined(PNG_TEXT_SUPPORTED) 65 #if defined(PNG_TEXT_SUPPORTED)
66 int i; 66 int i;
67 FX_STRSIZE len; 67 FX_STRSIZE len;
68 const FX_CHAR* buf; 68 const FX_CHAR* buf;
69 int num_text; 69 int num_text;
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 if (setjmp(png_jmpbuf(ctx->png_ptr))) { 247 if (setjmp(png_jmpbuf(ctx->png_ptr))) {
248 if (pAttribute && 248 if (pAttribute &&
249 0 == FXSYS_strcmp(m_szLastError, "Read Header Callback Error")) { 249 0 == FXSYS_strcmp(m_szLastError, "Read Header Callback Error")) {
250 _png_load_bmp_attribute(ctx->png_ptr, ctx->info_ptr, pAttribute); 250 _png_load_bmp_attribute(ctx->png_ptr, ctx->info_ptr, pAttribute);
251 } 251 }
252 return FALSE; 252 return FALSE;
253 } 253 }
254 png_process_data(ctx->png_ptr, ctx->info_ptr, (uint8_t*)src_buf, src_size); 254 png_process_data(ctx->png_ptr, ctx->info_ptr, (uint8_t*)src_buf, src_size);
255 return TRUE; 255 return TRUE;
256 } 256 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698