shithub: jbig2

Download patch

ref: a070ed1f94947a7014ddb34b27a01c1977bd1d77
parent: e360e8f2d17405cd733a62d11d8451b236ebdc56
author: Sebastian Rasmussen <[email protected]>
date: Sat Mar 21 11:59:21 EDT 2020

jbig2dec: Use correct define for maxium value of type.

Fixes Coverity CID 355177.

--- a/jbig2_page.c
+++ b/jbig2_page.c
@@ -80,11 +80,11 @@
             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));