summaryrefslogtreecommitdiff
path: root/core/fxcodec/jbig2/JBig2_Image.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-09-25 20:06:50 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-09-25 20:06:50 +0000
commit30dc6aaf878b2c55efcf7598fdb8886e06d14e01 (patch)
tree2de58de8c2eddd4efb5dc8a8c5b54cd3faad4972 /core/fxcodec/jbig2/JBig2_Image.cpp
parent958142efa4561b5efd52733ad6c3b889cf49b3ae (diff)
downloadpdfium-30dc6aaf878b2c55efcf7598fdb8886e06d14e01.tar.xz
Add FxAlignToBoundary<>() template helper function.
Because I nearly botched this trivial calculation in the previous CL. Change-Id: I7438f9d3476d93b7899c2d7d761234769f53f9e3 Reviewed-on: https://pdfium-review.googlesource.com/43010 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fxcodec/jbig2/JBig2_Image.cpp')
-rw-r--r--core/fxcodec/jbig2/JBig2_Image.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/fxcodec/jbig2/JBig2_Image.cpp b/core/fxcodec/jbig2/JBig2_Image.cpp
index 1194b1a402..a2d9f486e1 100644
--- a/core/fxcodec/jbig2/JBig2_Image.cpp
+++ b/core/fxcodec/jbig2/JBig2_Image.cpp
@@ -44,7 +44,7 @@ CJBig2_Image::CJBig2_Image(int32_t w, int32_t h) {
if (w <= 0 || h <= 0 || w > kMaxImagePixels)
return;
- int32_t stride_pixels = (w + 31) & ~31;
+ int32_t stride_pixels = FxAlignToBoundary<32>(w);
if (h > kMaxImagePixels / stride_pixels)
return;