diff options
author | Ken Sharp <ken.sharp@artifex.com> | 2023-04-19 13:18:06 +0100 |
---|---|---|
committer | Ken Sharp <ken.sharp@artifex.com> | 2023-04-19 13:18:06 +0100 |
commit | 563c3714b8cef948f11bf85ffa29640e2e04139f (patch) | |
tree | 014c6c8f9ff55619f505191ee1844bab882aa493 | |
parent | a099cd5cdb2854bcd722ceee25c99eb37ae3a12f (diff) | |
download | ghostpdl-563c3714b8cef948f11bf85ffa29640e2e04139f.tar.gz |
GhostPDF - improve commit a099cd5cdb2854bcd722ceee25c99eb37ae3a12f
The commit as is works, but it could fall foul of not checking the
state of 'negative' properly. It probably doesn't really matter (we
store the value as 64-bit anyway) but let's do this properly.
-rw-r--r-- | pdf/pdf_int.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pdf/pdf_int.c b/pdf/pdf_int.c index 5a78f134c..20bb743f3 100644 --- a/pdf/pdf_int.c +++ b/pdf/pdf_int.c @@ -262,7 +262,7 @@ static int pdfi_read_num(pdf_context *ctx, pdf_c_stream *s, uint32_t indirect_nu if (c >= '0' && c <= '9') { if (!(malformed && recovered) && !overflowed && !real) { - if ((negative && (int_val < tenth_max_int)) || int_val < tenth_max_uint) + if ((negative && int_val < tenth_max_int) || (!negative && int_val < tenth_max_uint)) int_val = int_val*10 + c - '0'; else { pdfi_set_error(ctx, 0, NULL, E_PDF_NUMBEROVERFLOW, "pdfi_read_num", NULL); |