summaryrefslogtreecommitdiff
path: root/samples/pdfium_test.cc
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-11-24 15:28:54 -0800
committerTom Sepez <tsepez@chromium.org>2015-11-24 15:28:54 -0800
commit38ad68cdea4fe106293d55ae1b96bab2791f96c7 (patch)
tree8d2f370304d4c34e5ac46a50fbe87f2d719a71f3 /samples/pdfium_test.cc
parente00cef685e1e4799e3ede59bb3bf18fe17ec6f19 (diff)
downloadpdfium-38ad68cdea4fe106293d55ae1b96bab2791f96c7.tar.xz
make master samples/ and public/ look more like XFA
BUG= R=thestig@chromium.org Review URL: https://codereview.chromium.org/1477603002 .
Diffstat (limited to 'samples/pdfium_test.cc')
-rw-r--r--samples/pdfium_test.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/samples/pdfium_test.cc b/samples/pdfium_test.cc
index 59a7a22d0e..1b3d82659c 100644
--- a/samples/pdfium_test.cc
+++ b/samples/pdfium_test.cc
@@ -135,10 +135,9 @@ static void WritePng(const char* pdf_name, int num, const void* buffer_void,
#ifdef _WIN32
static void WriteBmp(const char* pdf_name, int num, const void* buffer,
int stride, int width, int height) {
- if (stride < 0 || width < 0 || height < 0)
- return;
- if (height > 0 && width > INT_MAX / height)
+ if (!CheckDimensions(stride, width, height))
return;
+
int out_len = stride * height;
if (out_len > INT_MAX / 3)
return;
@@ -278,7 +277,6 @@ bool ParseCommandLine(const std::vector<std::string>& args,
}
options->font_directory = cur_arg.substr(11);
}
-
#ifdef _WIN32
else if (cur_arg == "--emf") {
if (options->output_format != OUTPUT_NONE) {