shithub: jbig2

Download patch

ref: dc8f364a1289bb8235afec4dae78a08e5d6d6155
parent: e1a691ca498dd4aa4808b94edfb9b3448ca7ed51
author: Sebastian Rasmussen <[email protected]>
date: Fri Aug 3 15:10:09 EDT 2018

jbig2dec: When reading past the end of a word stream, return 0.

Previously the returned value would be uninitialized, leading
to issues detected by valgrind later on in the parsing.

--- a/jbig2.c
+++ b/jbig2.c
@@ -451,8 +451,10 @@
 
     if (self == NULL || word == NULL)
         return -1;
-    if (offset >= z->size)
+    if (offset >= z->size) {
+        *word = 0;
         return 0;
+    }
 
     if (offset < z->size) {
         val |= data[offset] << 24;