summaryrefslogtreecommitdiff
path: root/third_party/libtiff/0018-fix-leak-in-PredictorSetupDecode.patch
blob: e7758eb57322d0fe48c1e0f7451271523df69a9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/third_party/libtiff/tif_predict.c b/third_party/libtiff/tif_predict.c
index 1bb78e209..0b185d2e2 100644
--- a/third_party/libtiff/tif_predict.c
+++ b/third_party/libtiff/tif_predict.c
@@ -118,7 +118,10 @@ PredictorSetupDecode(TIFF* tif)
 	TIFFDirectory* td = &tif->tif_dir;
 
 	if (!(*sp->setupdecode)(tif) || !PredictorSetup(tif))
+	{
+		(*tif->tif_cleanup)(tif);
 		return 0;
+	}
 
 	if (sp->predictor == 2) {
 		switch (td->td_bitspersample) {