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

Issue 1142713005: Remove FX_Alloc() null checks now that it can't return NULL. (Closed)

Created:
5 years, 7 months ago by Tom Sepez
Modified:
5 years, 7 months ago
Reviewers:
Lei Zhang
CC:
pdfium-reviews_googlegroups.com
Base URL:
https://pdfium.googlesource.com/pdfium.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Remove FX_Alloc() null checks now that it can't return NULL. This permits some functions to become void's since they, in turn, can't fail. R=thestig@chromium.org Committed: https://pdfium.googlesource.com/pdfium/+/eb6527763171cdb4b0fbfea5a20d691f4d67b660

Patch Set 1 #

Total comments: 6

Patch Set 2 : Fix missing FX_Alloc2D, check overflow on add, remove unused enum. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+97 lines, -455 lines) Patch
M core/include/fxcodec/fx_codec_def.h View 1 1 chunk +0 lines, -1 line 0 comments Download
M core/include/fxge/fx_ge.h View 2 chunks +6 lines, -9 lines 0 comments Download
M core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp View 1 chunk +0 lines, -3 lines 0 comments Download
M core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp View 1 4 chunks +6 lines, -12 lines 0 comments Download
M core/src/fpdfapi/fpdf_page/fpdf_page.cpp View 1 chunk +2 lines, -3 lines 0 comments Download
M core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp View 2 chunks +2 lines, -6 lines 0 comments Download
M core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp View 2 chunks +0 lines, -6 lines 0 comments Download
M core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp View 2 chunks +1 line, -4 lines 0 comments Download
M core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp View 1 chunk +0 lines, -3 lines 0 comments Download
M core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp View 1 chunk +0 lines, -3 lines 0 comments Download
M core/src/fpdfdoc/doc_annot.cpp View 4 chunks +0 lines, -12 lines 0 comments Download
M core/src/fpdftext/fpdf_text.cpp View 1 chunk +33 lines, -35 lines 0 comments Download
M core/src/fpdftext/fpdf_text_int.cpp View 2 chunks +0 lines, -6 lines 0 comments Download
M core/src/fxcodec/codec/fx_codec.cpp View 1 chunk +0 lines, -3 lines 0 comments Download
M core/src/fxcodec/codec/fx_codec_fax.cpp View 3 chunks +0 lines, -12 lines 0 comments Download
M core/src/fxcodec/codec/fx_codec_flate.cpp View 10 chunks +3 lines, -39 lines 0 comments Download
M core/src/fxcodec/codec/fx_codec_icc.cpp View 2 chunks +0 lines, -6 lines 0 comments Download
M core/src/fxcodec/codec/fx_codec_jbig.cpp View 2 chunks +0 lines, -6 lines 0 comments Download
M core/src/fxcodec/codec/fx_codec_jpx_opj.cpp View 1 chunk +0 lines, -6 lines 0 comments Download
M core/src/fxcrt/extension.h View 2 chunks +1 line, -6 lines 0 comments Download
M core/src/fxcrt/fx_basic_array.cpp View 4 chunks +0 lines, -15 lines 0 comments Download
M core/src/fxcrt/fx_basic_bstring.cpp View 1 chunk +0 lines, -3 lines 0 comments Download
M core/src/fxcrt/fx_basic_buffer.cpp View 2 chunks +2 lines, -7 lines 0 comments Download
M core/src/fxcrt/fx_basic_maps.cpp View 1 chunk +1 line, -3 lines 0 comments Download
M core/src/fxcrt/fx_basic_plex.cpp View 1 chunk +0 lines, -3 lines 0 comments Download
M core/src/fxcrt/fx_basic_wstring.cpp View 1 chunk +0 lines, -3 lines 0 comments Download
M core/src/fxcrt/fx_extension.cpp View 1 chunk +0 lines, -3 lines 0 comments Download
M core/src/fxcrt/fxcrt_platforms.cpp View 1 chunk +0 lines, -3 lines 0 comments Download
M core/src/fxcrt/fxcrt_posix.cpp View 1 chunk +0 lines, -3 lines 0 comments Download
M core/src/fxcrt/xml_int.h View 1 chunk +0 lines, -3 lines 0 comments Download
M core/src/fxge/agg/agg23/agg_array.h View 1 chunk +1 line, -5 lines 0 comments Download
M core/src/fxge/agg/agg23/fx_agg_path_storage.cpp View 1 chunk +0 lines, -3 lines 0 comments Download
M core/src/fxge/agg/agg23/fx_agg_rasterizer_scanline_aa.cpp View 2 chunks +0 lines, -6 lines 0 comments Download
M core/src/fxge/dib/fx_dib_composite.cpp View 9 chunks +0 lines, -37 lines 0 comments Download
M core/src/fxge/dib/fx_dib_convert.cpp View 3 chunks +0 lines, -12 lines 0 comments Download
M core/src/fxge/dib/fx_dib_engine.cpp View 1 chunk +0 lines, -6 lines 0 comments Download
M core/src/fxge/dib/fx_dib_main.cpp View 4 chunks +3 lines, -12 lines 0 comments Download
M core/src/fxge/ge/fx_ge_font.cpp View 2 chunks +0 lines, -6 lines 0 comments Download
M core/src/fxge/ge/fx_ge_fontmap.cpp View 3 chunks +3 lines, -16 lines 0 comments Download
M core/src/fxge/ge/fx_ge_path.cpp View 1 9 chunks +19 lines, -44 lines 0 comments Download
M core/src/fxge/ge/fx_ge_ps.cpp View 2 chunks +0 lines, -10 lines 0 comments Download
M core/src/fxge/ge/fx_ge_text.cpp View 1 chunk +0 lines, -3 lines 0 comments Download
M core/src/fxge/win32/fx_win32_device.cpp View 1 chunk +0 lines, -3 lines 0 comments Download
M core/src/fxge/win32/fx_win32_dib.cpp View 2 chunks +0 lines, -13 lines 0 comments Download
M core/src/fxge/win32/fx_win32_gdipext.cpp View 5 chunks +0 lines, -28 lines 0 comments Download
M core/src/fxge/win32/fx_win32_print.cpp View 1 chunk +0 lines, -3 lines 0 comments Download
M fpdfsdk/src/fsdk_baseform.cpp View 1 chunk +1 line, -4 lines 0 comments Download
M fpdfsdk/src/pdfwindow/PWL_Edit.cpp View 2 chunks +13 lines, -17 lines 0 comments Download

Messages

Total messages: 7 (1 generated)
Tom Sepez
Lei, for review.
5 years, 7 months ago (2015-05-19 00:04:51 UTC) #2
Lei Zhang
https://codereview.chromium.org/1142713005/diff/1/core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp File core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp (right): https://codereview.chromium.org/1142713005/diff/1/core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp#newcode318 core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp:318: dest_buf = FX_Alloc(FX_BYTE, dest_pitch * BitmapHeight); FX_Alloc2D() ! https://codereview.chromium.org/1142713005/diff/1/core/src/fxcodec/codec/fx_codec_jbig.cpp ...
5 years, 7 months ago (2015-05-19 18:58:54 UTC) #3
Lei Zhang
https://codereview.chromium.org/1142713005/diff/1/core/src/fxge/ge/fx_ge_path.cpp File core/src/fxge/ge/fx_ge_path.cpp (right): https://codereview.chromium.org/1142713005/diff/1/core/src/fxge/ge/fx_ge_path.cpp#newcode164 core/src/fxge/ge/fx_ge_path.cpp:164: int new_count = m_PointCount + addPoints; note for later: ...
5 years, 7 months ago (2015-05-19 19:07:17 UTC) #4
Tom Sepez
https://codereview.chromium.org/1142713005/diff/1/core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp File core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp (right): https://codereview.chromium.org/1142713005/diff/1/core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp#newcode318 core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp:318: dest_buf = FX_Alloc(FX_BYTE, dest_pitch * BitmapHeight); On 2015/05/19 18:58:53, ...
5 years, 7 months ago (2015-05-19 20:08:57 UTC) #5
Lei Zhang
lgtm
5 years, 7 months ago (2015-05-19 20:21:13 UTC) #6
Tom Sepez
5 years, 7 months ago (2015-05-19 21:48:07 UTC) #7
Message was sent while issue was closed.
Committed patchset #2 (id:20001) manually as
eb6527763171cdb4b0fbfea5a20d691f4d67b660 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698