From a80f7f12e7a2fb0caa1ea9ac6fa8981cc539a1bc Mon Sep 17 00:00:00 2001
From: Sebastian Rasmussen <sebras@gmail.com>
Date: Sat, 21 Mar 2020 15:59:21 +0800
Subject: [PATCH] jbig2dec: Use correct define for maxium value of type.

Fixes Coverity CID 355177.
---
 jbig2dec/jbig2_page.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/jbig2dec/jbig2_page.c b/jbig2dec/jbig2_page.c
index bc89a43..92486dd 100644
--- a/jbig2dec/jbig2_page.c
+++ b/jbig2dec/jbig2_page.c
@@ -80,11 +80,11 @@ jbig2_page_info(Jbig2Ctx *ctx, Jbig2Segment *segment, const uint8_t *segment_dat
             if (index >= ctx->max_page_index) {
                 /* grow the list */
 
-                if (ctx->max_page_index == SIZE_MAX) {
+                if (ctx->max_page_index == UINT32_MAX) {
                     return jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number, "too many pages in jbig2 image");
                 }
-                else if (ctx->max_page_index > (SIZE_MAX >> 2)) {
-                    ctx->max_page_index = SIZE_MAX;
+                else if (ctx->max_page_index > (UINT32_MAX >> 2)) {
+                    ctx->max_page_index = UINT32_MAX;
                 }
 
                 pages = jbig2_renew(ctx, ctx->pages, Jbig2Page, (ctx->max_page_index <<= 2));
-- 
1.8.3.1

