From 164673834befb46b549ff6198f95dcdede417222 Mon Sep 17 00:00:00 2001 From: Andrey Kiselev Date: Thu, 2 Sep 2004 14:24:57 +0000 Subject: [PATCH] Use memcpy() function instead of pointer assigning magic in TIFFFetchFloat(). --- libtiff/tif_dirread.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libtiff/tif_dirread.c b/libtiff/tif_dirread.c index e3f16487..070769a3 100644 --- a/libtiff/tif_dirread.c +++ b/libtiff/tif_dirread.c @@ -1,4 +1,4 @@ -/* $Id: tif_dirread.c,v 1.33 2004-08-23 19:04:40 dron Exp $ */ +/* $Id: tif_dirread.c,v 1.34 2004-09-02 14:24:57 dron Exp $ */ /* * Copyright (c) 1988-1997 Sam Leffler @@ -808,8 +808,9 @@ TIFFFetchRational(TIFF* tif, TIFFDirEntry* dir) static float TIFFFetchFloat(TIFF* tif, TIFFDirEntry* dir) { - long l = TIFFExtractData(tif, dir->tdir_type, dir->tdir_offset); - float v = *(float*) &l; + float v; + int32 l = TIFFExtractData(tif, dir->tdir_type, dir->tdir_offset); + memcpy(&v, &l, sizeof(float)); TIFFCvtIEEEFloatToNative(tif, 1, &v); return (v); } @@ -1482,3 +1483,5 @@ ChopUpSingleUncompressedStrip(TIFF* tif) td->td_stripbytecount = newcounts; td->td_stripoffset = newoffsets; } + +/* vim: set ts=8 sts=8 sw=8 noet: */