https://github.com/libsdl-org/libtiff/commit/1c6a5c0fb3fe1a9b0e5b77a496541de4ae71411d
From 1c6a5c0fb3fe1a9b0e5b77a496541de4ae71411d Mon Sep 17 00:00:00 2001
From: Bob Friesenhahn <[EMAIL REDACTED]>
Date: Thu, 29 Oct 2009 20:04:32 +0000
Subject: [PATCH] * libtiff/tif_dirread.c: Eliminate GCC "dereferencing
type-punned pointer" warnings.
---
ChangeLog | 5 +++++
libtiff/tif_dirread.c | 11 +++++++++--
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index a5f8f5fe..bf28698d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-10-29 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
+
+ * libtiff/tif_dirread.c: Eliminate GCC "dereferencing type-punned
+ pointer" warnings.
+
2009-10-28 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
* html/tools.html: Add manual page links, and a summary
diff --git a/libtiff/tif_dirread.c b/libtiff/tif_dirread.c
index b04327cf..52d53fc3 100644
--- a/libtiff/tif_dirread.c
+++ b/libtiff/tif_dirread.c
@@ -1,4 +1,4 @@
-/* $Id: tif_dirread.c,v 1.92.2.5 2009-01-01 00:10:43 bfriesen Exp $ */
+/* $Id: tif_dirread.c,v 1.92.2.6 2009-10-29 20:04:32 bfriesen Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
@@ -1426,7 +1426,14 @@ TIFFFetchFloatArray(TIFF* tif, TIFFDirEntry* dir, float* v)
{
if (dir->tdir_count == 1) {
- v[0] = *(float*) &dir->tdir_offset;
+ union
+ {
+ float f;
+ uint32 i;
+ } float_union;
+
+ float_union.i=dir->tdir_offset;
+ v[0]=float_union.f;
TIFFCvtIEEEFloatToNative(tif, dir->tdir_count, v);
return (1);
} else if (TIFFFetchData(tif, dir, (char*) v)) {