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

Issue 1016203002: Fix subtle issues in opj_skip_from_memory and add unit tests. (Closed)

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

Description

Fix subtle issues in opj_skip_from_memory and add unit tests. Follow on to https://codereview.chromium.org/990683002/. This more closely mimics what fseek() actually does, so as to avoid subtle bugs down the road. Move the DecodeData struct into a header so the test can use it, and provide a constructor for it. Along the way, I added include guards, removed the p_ prefix from some non-pointer vars, fixed some IWYU, and resolved some signed/unsigned comparison warnings with careful casting. BUG=452671 R=jun_fang@foxitsoftware.com, thestig@chromium.org Committed: https://pdfium.googlesource.com/pdfium/+/d1f792ac1ba25494b44e664d4a427127299d05e6

Patch Set 1 #

Patch Set 2 : Fix type botch. #

Total comments: 6

Patch Set 3 : GN #

Patch Set 4 : Add one more useless test. #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+556 lines, -31 lines) Patch
M BUILD.gn View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M core/src/fxcodec/codec/codec_int.h View 2 chunks +25 lines, -0 lines 0 comments Download
M core/src/fxcodec/codec/fx_codec_jpx_opj.cpp View 3 chunks +59 lines, -31 lines 0 comments Download
A core/src/fxcodec/codec/fx_codec_jpx_unittest.cpp View 1 2 3 1 chunk +470 lines, -0 lines 2 comments Download
M pdfium.gyp View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 10 (2 generated)
Tom Sepez
Please review. Jun, in particular when I suggested the prior patch needed a unit test, ...
5 years, 9 months ago (2015-03-18 23:44:05 UTC) #2
jun_fang
https://codereview.chromium.org/1016203002/diff/20001/core/src/fxcodec/codec/fx_codec_jpx_opj.cpp File core/src/fxcodec/codec/fx_codec_jpx_opj.cpp (right): https://codereview.chromium.org/1016203002/diff/20001/core/src/fxcodec/codec/fx_codec_jpx_opj.cpp#newcode84 core/src/fxcodec/codec/fx_codec_jpx_opj.cpp:84: srcData->offset = std::min(srcData->offset + checkedNbBytes, srcData->src_size); In this case, ...
5 years, 9 months ago (2015-03-19 00:28:46 UTC) #3
Tom Sepez
https://codereview.chromium.org/1016203002/diff/20001/core/src/fxcodec/codec/fx_codec_jpx_opj.cpp File core/src/fxcodec/codec/fx_codec_jpx_opj.cpp (right): https://codereview.chromium.org/1016203002/diff/20001/core/src/fxcodec/codec/fx_codec_jpx_opj.cpp#newcode84 core/src/fxcodec/codec/fx_codec_jpx_opj.cpp:84: srcData->offset = std::min(srcData->offset + checkedNbBytes, srcData->src_size); On 2015/03/19 00:28:46, ...
5 years, 9 months ago (2015-03-19 00:35:16 UTC) #4
jun_fang
https://codereview.chromium.org/1016203002/diff/20001/core/src/fxcodec/codec/fx_codec_jpx_opj.cpp File core/src/fxcodec/codec/fx_codec_jpx_opj.cpp (right): https://codereview.chromium.org/1016203002/diff/20001/core/src/fxcodec/codec/fx_codec_jpx_opj.cpp#newcode84 core/src/fxcodec/codec/fx_codec_jpx_opj.cpp:84: srcData->offset = std::min(srcData->offset + checkedNbBytes, srcData->src_size); On 2015/03/19 00:35:16, ...
5 years, 9 months ago (2015-03-19 00:48:35 UTC) #5
jun_fang
On 2015/03/19 00:48:35, jun_fang wrote: > https://codereview.chromium.org/1016203002/diff/20001/core/src/fxcodec/codec/fx_codec_jpx_opj.cpp > File core/src/fxcodec/codec/fx_codec_jpx_opj.cpp (right): > > https://codereview.chromium.org/1016203002/diff/20001/core/src/fxcodec/codec/fx_codec_jpx_opj.cpp#newcode84 > ...
5 years, 9 months ago (2015-03-19 00:48:54 UTC) #6
Lei Zhang
lgtm https://codereview.chromium.org/1016203002/diff/60001/core/src/fxcodec/codec/fx_codec_jpx_unittest.cpp File core/src/fxcodec/codec/fx_codec_jpx_unittest.cpp (right): https://codereview.chromium.org/1016203002/diff/60001/core/src/fxcodec/codec/fx_codec_jpx_unittest.cpp#newcode17 core/src/fxcodec/codec/fx_codec_jpx_unittest.cpp:17: static unsigned char stream_data[] = { can this ...
5 years, 9 months ago (2015-03-19 01:35:51 UTC) #8
Tom Sepez
https://codereview.chromium.org/1016203002/diff/60001/core/src/fxcodec/codec/fx_codec_jpx_unittest.cpp File core/src/fxcodec/codec/fx_codec_jpx_unittest.cpp (right): https://codereview.chromium.org/1016203002/diff/60001/core/src/fxcodec/codec/fx_codec_jpx_unittest.cpp#newcode17 core/src/fxcodec/codec/fx_codec_jpx_unittest.cpp:17: static unsigned char stream_data[] = { On 2015/03/19 01:35:51, ...
5 years, 9 months ago (2015-03-19 18:02:10 UTC) #9
Tom Sepez
5 years, 9 months ago (2015-03-19 19:51:09 UTC) #10
Message was sent while issue was closed.
Committed patchset #4 (id:60001) manually as
d1f792ac1ba25494b44e664d4a427127299d05e6 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698