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

Issue 1388203003: Sanitize CJBig2_SymbolDict's memory usage. (Closed)

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

Description

Sanitize CJBig2_SymbolDict's memory usage. - Use std::vector<JBig2ArithCtx> instead of storing pointers to arrays. - Make CJBig2_SymbolDict's members private with accessors. - Use std::vector<JBig2ArithCtx> in related places. - Steal Chromium's vector_as_array() and use it as an adaptor as needed. BUG=514891 R=tsepez@chromium.org Committed: https://pdfium.googlesource.com/pdfium/+/3acb1ef909a22368507ed13817c4988c818e3aee

Patch Set 1 #

Patch Set 2 : more checks #

Total comments: 5

Patch Set 3 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+103 lines, -73 lines) Patch
M core/src/fxcodec/jbig2/JBig2_Context.cpp View 1 4 chunks +33 lines, -39 lines 0 comments Download
M core/src/fxcodec/jbig2/JBig2_SddProc.h View 1 chunk +7 lines, -6 lines 0 comments Download
M core/src/fxcodec/jbig2/JBig2_SddProc.cpp View 8 chunks +16 lines, -11 lines 0 comments Download
M core/src/fxcodec/jbig2/JBig2_SymbolDict.h View 2 chunks +14 lines, -5 lines 0 comments Download
M core/src/fxcodec/jbig2/JBig2_SymbolDict.cpp View 1 chunk +3 lines, -11 lines 0 comments Download
M third_party/BUILD.gn View 1 chunk +1 line, -0 lines 0 comments Download
A third_party/base/stl_util.h View 1 chunk +27 lines, -0 lines 0 comments Download
M third_party/third_party.gyp View 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 12 (2 generated)
Lei Zhang
The behavior does change a bit since CJBig2_SymbolDict's DeepCopy() can no longer fail. I have ...
5 years, 2 months ago (2015-10-09 08:55:54 UTC) #2
Lei Zhang
I can't trigger the condition with Karl's test PDF, but more checks in patch set ...
5 years, 2 months ago (2015-10-09 09:20:08 UTC) #3
Tom Sepez
https://codereview.chromium.org/1388203003/diff/20001/core/src/fxcodec/jbig2/JBig2_Context.cpp File core/src/fxcodec/jbig2/JBig2_Context.cpp (left): https://codereview.chromium.org/1388203003/diff/20001/core/src/fxcodec/jbig2/JBig2_Context.cpp#oldcode573 core/src/fxcodec/jbig2/JBig2_Context.cpp:573: if ((wFlags & 0x0100) && pLRSeg && pLRSeg->m_Result.sd->m_bContextRetained) { ...
5 years, 2 months ago (2015-10-09 16:10:52 UTC) #4
Lei Zhang
https://codereview.chromium.org/1388203003/diff/20001/core/src/fxcodec/jbig2/JBig2_Context.cpp File core/src/fxcodec/jbig2/JBig2_Context.cpp (left): https://codereview.chromium.org/1388203003/diff/20001/core/src/fxcodec/jbig2/JBig2_Context.cpp#oldcode573 core/src/fxcodec/jbig2/JBig2_Context.cpp:573: if ((wFlags & 0x0100) && pLRSeg && pLRSeg->m_Result.sd->m_bContextRetained) { ...
5 years, 2 months ago (2015-10-09 18:50:28 UTC) #5
Lei Zhang
https://codereview.chromium.org/1388203003/diff/20001/core/src/fxcodec/jbig2/JBig2_SymbolDict.h File core/src/fxcodec/jbig2/JBig2_SymbolDict.h (right): https://codereview.chromium.org/1388203003/diff/20001/core/src/fxcodec/jbig2/JBig2_SymbolDict.h#newcode36 core/src/fxcodec/jbig2/JBig2_SymbolDict.h:36: m_gbContext = gbContext; On 2015/10/09 16:10:52, Tom Sepez wrote: ...
5 years, 2 months ago (2015-10-09 18:59:52 UTC) #6
Tom Sepez
On 2015/10/09 18:59:52, Lei Zhang wrote: > https://codereview.chromium.org/1388203003/diff/20001/core/src/fxcodec/jbig2/JBig2_SymbolDict.h > File core/src/fxcodec/jbig2/JBig2_SymbolDict.h (right): > > https://codereview.chromium.org/1388203003/diff/20001/core/src/fxcodec/jbig2/JBig2_SymbolDict.h#newcode36 ...
5 years, 2 months ago (2015-10-09 19:01:13 UTC) #7
Tom Sepez
Ah, LGTM.
5 years, 2 months ago (2015-10-09 19:02:40 UTC) #8
Nico
https://codereview.chromium.org/1388203003/diff/20001/core/src/fxcodec/jbig2/JBig2_SymbolDict.h File core/src/fxcodec/jbig2/JBig2_SymbolDict.h (right): https://codereview.chromium.org/1388203003/diff/20001/core/src/fxcodec/jbig2/JBig2_SymbolDict.h#newcode36 core/src/fxcodec/jbig2/JBig2_SymbolDict.h:36: m_gbContext = gbContext; On 2015/10/09 18:59:52, Lei Zhang wrote: ...
5 years, 2 months ago (2015-10-09 20:23:24 UTC) #10
Lei Zhang
Ok, then landing as is.
5 years, 2 months ago (2015-10-09 20:50:27 UTC) #11
Lei Zhang
5 years, 2 months ago (2015-10-09 20:51:08 UTC) #12
Message was sent while issue was closed.
Committed patchset #3 (id:40001) manually as
3acb1ef909a22368507ed13817c4988c818e3aee (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698