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

Issue 1990843004: Fix Undefined-shift in CPDF_SampledFunc::v_Init(). (Closed)

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

Description

Fix Undefined-shift in CPDF_SampledFunc::v_Init(). Also fix a divide by zero in CPDF_SampledFunc. Do some cleanups too. BUG=596530, 613032 Committed: https://pdfium.googlesource.com/pdfium/+/9b1a0ee2a8f24411609a2f7554119597950dbd04

Patch Set 1 #

Patch Set 2 : more cleanup #

Patch Set 3 : more cleanup #

Patch Set 4 : Tighten up BitsPerSample check per spec #

Patch Set 5 : Calculate m_SampleMax correctly per spec #

Patch Set 6 : Fix bug 596530 as well #

Total comments: 6

Patch Set 7 : address comments #

Patch Set 8 : rebase #

Total comments: 2

Patch Set 9 : compile #

Unified diffs Side-by-side diffs Delta from patch set Stats (+114 lines, -93 lines) Patch
M core/fpdfapi/fpdf_page/fpdf_page_func.cpp View 1 2 3 4 5 6 7 8 15 chunks +100 lines, -80 lines 0 comments Download
M core/fpdfapi/fpdf_page/pageint.h View 1 2 3 4 5 6 5 chunks +14 lines, -13 lines 0 comments Download

Messages

Total messages: 16 (5 generated)
Lei Zhang
4 years, 7 months ago (2016-05-19 07:00:17 UTC) #2
Tom Sepez
https://codereview.chromium.org/1990843004/diff/100001/core/fpdfapi/fpdf_page/fpdf_page_func.cpp File core/fpdfapi/fpdf_page/fpdf_page_func.cpp (right): https://codereview.chromium.org/1990843004/diff/100001/core/fpdfapi/fpdf_page/fpdf_page_func.cpp#newcode507 core/fpdfapi/fpdf_page/fpdf_page_func.cpp:507: uint32_t GetBits32(const uint8_t* pData, int bitpos, int nbits) { ...
4 years, 7 months ago (2016-05-19 16:53:40 UTC) #4
Tom Sepez
https://codereview.chromium.org/1990843004/diff/100001/core/fpdfapi/fpdf_page/fpdf_page_func.cpp File core/fpdfapi/fpdf_page/fpdf_page_func.cpp (right): https://codereview.chromium.org/1990843004/diff/100001/core/fpdfapi/fpdf_page/fpdf_page_func.cpp#newcode569 core/fpdfapi/fpdf_page/fpdf_page_func.cpp:569: 0xffffffff >> (m_nBitsPerSample == 32 ? 0 : 32 ...
4 years, 7 months ago (2016-05-19 16:58:48 UTC) #5
Lei Zhang
https://codereview.chromium.org/1990843004/diff/100001/core/fpdfapi/fpdf_page/fpdf_page_func.cpp File core/fpdfapi/fpdf_page/fpdf_page_func.cpp (right): https://codereview.chromium.org/1990843004/diff/100001/core/fpdfapi/fpdf_page/fpdf_page_func.cpp#newcode507 core/fpdfapi/fpdf_page/fpdf_page_func.cpp:507: uint32_t GetBits32(const uint8_t* pData, int bitpos, int nbits) { ...
4 years, 7 months ago (2016-05-19 21:16:19 UTC) #6
Tom Sepez
... and windows warns about the same thing I just suggested. LGTM once that's fixed. ...
4 years, 7 months ago (2016-05-19 21:31:46 UTC) #7
Lei Zhang
https://codereview.chromium.org/1990843004/diff/140001/core/fpdfapi/fpdf_page/fpdf_page_func.cpp File core/fpdfapi/fpdf_page/fpdf_page_func.cpp (right): https://codereview.chromium.org/1990843004/diff/140001/core/fpdfapi/fpdf_page/fpdf_page_func.cpp#newcode568 core/fpdfapi/fpdf_page/fpdf_page_func.cpp:568: m_SampleMax = 0xffffffff >> 32 - m_nBitsPerSample; On 2016/05/19 ...
4 years, 7 months ago (2016-05-19 21:58:23 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1990843004/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1990843004/160001
4 years, 7 months ago (2016-05-19 22:32:45 UTC) #11
commit-bot: I haz the power
Committed patchset #9 (id:160001) as https://pdfium.googlesource.com/pdfium/+/9b1a0ee2a8f24411609a2f7554119597950dbd04
4 years, 7 months ago (2016-05-19 22:47:04 UTC) #13
Lei Zhang
Oh, I think I broke Skia. Sorry.
4 years, 7 months ago (2016-05-19 23:02:28 UTC) #14
Lei Zhang
On 2016/05/19 23:02:28, Lei Zhang wrote: > Oh, I think I broke Skia. Sorry. That ...
4 years, 7 months ago (2016-05-19 23:03:32 UTC) #15
Lei Zhang
4 years, 7 months ago (2016-05-19 23:36:53 UTC) #16
Message was sent while issue was closed.
On 2016/05/19 23:03:32, Lei Zhang wrote:
> On 2016/05/19 23:02:28, Lei Zhang wrote:
> > Oh, I think I broke Skia. Sorry.
> 
> That is to say, let me whip up a CL to remedy the situation, rather than
> reverting.

Follow up: https://codereview.chromium.org/1996533004

Powered by Google App Engine
This is Rietveld 408576698