summaryrefslogtreecommitdiff
path: root/media-libs/tiff/files/tiff-4.0.7-pdfium-0007-uninitialized-value.patch
blob: ab5627f5c1697b99a28d9df4ee17a27d7b62ac4d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
https://codereview.chromium.org/2389993002
https://crbug.com/651632
https://pdfium.googlesource.com/pdfium/+/master/libtiff/

Author: dsinclair <dsinclair@chromium.org>
Date:   Mon Oct 3 13:59:57 2016 -0700

Fix potentially uninitialized value.

Depending on what ReadOK does it's possible for |dircount16| to be used without
being initialized. The read code calls back into PDFium specific code which then
calls into the stream reading code.

Initialize the value to be sure it is set.

--- a/libtiff/tif_dirread.c
+++ b/libtiff/tif_dirread.c
@@ -4443,7 +4443,7 @@ TIFFFetchDirectory(TIFF* tif, uint64 diroff, TIFFDirEntry** pdir,
 	static const char module[] = "TIFFFetchDirectory";
 
 	void* origdir;
-	uint16 dircount16;
+	uint16 dircount16 = 0;
 	uint32 dirsize;
 	TIFFDirEntry* dir;
 	uint8* ma;