# HG changeset patch # User prr # Date 1527869796 25200 # Node ID 071f1fe0df5f6bc4fc6c50e2fb46997d2f30fdda # Parent 8fbbd19bf3a152e302784684ad2a9ce88f137601 8200052: libjavajpeg: Fix compile warning in jchuff.c Reviewed-by: prr Contributed-by: adam.farley@uk.ibm.com, thomas.stuefe@sap.com diff -r 8fbbd19bf3a1 -r 071f1fe0df5f src/java.desktop/share/native/libjavajpeg/jchuff.c --- a/src/java.desktop/share/native/libjavajpeg/jchuff.c Wed May 30 15:01:36 2018 +0200 +++ b/src/java.desktop/share/native/libjavajpeg/jchuff.c Fri Jun 01 09:16:36 2018 -0700 @@ -805,8 +805,11 @@ for (i = MAX_CLEN; i > 16; i--) { while (bits[i] > 0) { j = i - 2; /* find length of new prefix to be used */ - while (bits[j] == 0) + while (bits[j] == 0) { + if (j == 0) + ERREXIT(cinfo, JERR_HUFF_CLEN_OVERFLOW); j--; + } bits[i] -= 2; /* remove two symbols */ bits[i-1]++; /* one goes in this length */