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

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

Issue 312273002: fix two uninitialized reads (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: Created 6 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
« no previous file with comments | « no previous file | core/src/fxge/fx_freetype/fxft2.5.01/src/psaux/psconv.c » ('j') | 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 "../../../include/fxcodec/fx_codec.h" 7 #include "../../../include/fxcodec/fx_codec.h"
8 #include "../../../include/fxge/fx_dib.h" 8 #include "../../../include/fxge/fx_dib.h"
9 #include "codec_int.h" 9 #include "codec_int.h"
10 extern "C" { 10 extern "C" {
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 FX_LPBYTE* icc_buf_ptr, FX_DWORD* icc_length) 275 FX_LPBYTE* icc_buf_ptr, FX_DWORD* icc_length)
276 { 276 {
277 _JpegScanSOI(src_buf, src_size); 277 _JpegScanSOI(src_buf, src_size);
278 struct jpeg_decompress_struct cinfo; 278 struct jpeg_decompress_struct cinfo;
279 struct jpeg_error_mgr jerr; 279 struct jpeg_error_mgr jerr;
280 jerr.error_exit = _error_fatal; 280 jerr.error_exit = _error_fatal;
281 jerr.emit_message = _error_do_nothing1; 281 jerr.emit_message = _error_do_nothing1;
282 jerr.output_message = _error_do_nothing; 282 jerr.output_message = _error_do_nothing;
283 jerr.format_message = _error_do_nothing2; 283 jerr.format_message = _error_do_nothing2;
284 jerr.reset_error_mgr = _error_do_nothing; 284 jerr.reset_error_mgr = _error_do_nothing;
285 jerr.trace_level = 0;
285 cinfo.err = &jerr; 286 cinfo.err = &jerr;
286 jmp_buf mark; 287 jmp_buf mark;
287 cinfo.client_data = &mark; 288 cinfo.client_data = &mark;
288 if (setjmp(mark) == -1) { 289 if (setjmp(mark) == -1) {
289 return FALSE; 290 return FALSE;
290 } 291 }
291 jpeg_create_decompress(&cinfo); 292 jpeg_create_decompress(&cinfo);
292 struct jpeg_source_mgr src; 293 struct jpeg_source_mgr src;
293 src.init_source = _src_do_nothing; 294 src.init_source = _src_do_nothing;
294 src.term_source = _src_do_nothing; 295 src.term_source = _src_do_nothing;
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
726 return m_pExtProvider->GetAvailInput(pContext, avail_buf_ptr); 727 return m_pExtProvider->GetAvailInput(pContext, avail_buf_ptr);
727 } 728 }
728 if(avail_buf_ptr != NULL) { 729 if(avail_buf_ptr != NULL) {
729 *avail_buf_ptr = NULL; 730 *avail_buf_ptr = NULL;
730 if(((FXJPEG_Context*)pContext)->m_SrcMgr.bytes_in_buffer > 0) { 731 if(((FXJPEG_Context*)pContext)->m_SrcMgr.bytes_in_buffer > 0) {
731 *avail_buf_ptr = (FX_LPBYTE)((FXJPEG_Context*)pContext)->m_SrcMgr.ne xt_input_byte; 732 *avail_buf_ptr = (FX_LPBYTE)((FXJPEG_Context*)pContext)->m_SrcMgr.ne xt_input_byte;
732 } 733 }
733 } 734 }
734 return (FX_DWORD)((FXJPEG_Context*)pContext)->m_SrcMgr.bytes_in_buffer; 735 return (FX_DWORD)((FXJPEG_Context*)pContext)->m_SrcMgr.bytes_in_buffer;
735 } 736 }
OLDNEW
« no previous file with comments | « no previous file | core/src/fxge/fx_freetype/fxft2.5.01/src/psaux/psconv.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698