Browse code

bb #8385: PDF ASCII85Decode zero-length fix

David Raynor authored on 2013/07/31 04:07:25
Showing 1 changed files
... ...
@@ -929,8 +929,13 @@ static int pdf_extract_obj(struct pdf_struct *pdf, struct pdf_obj *obj)
929 929
 			   orig_length, length, size);
930 930
 		pdfobj_flag(pdf, obj, BAD_STREAMLEN);
931 931
 	    }
932
-	    if (!length)
932
+	    if (!length) {
933 933
 		length = size;
934
+		if (!length) {
935
+		    cli_dbgmsg("pdf_extract_obj: length and size both 0\n");
936
+		    break; /* Empty stream, nothing to scan */
937
+		}
938
+	    }
934 939
 
935 940
 	    flate_orig = flate_in = start + p_stream;
936 941
             flate_orig_length = length;