Created
April 19, 2016 01:09
-
-
Save updateing/2b58ebd4a8c75780443f28f514e9bb39 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From efdfdede52181591db3d85a8622bb79a1fb1262b Mon Sep 17 00:00:00 2001 | |
From: Hamster Tian <[email protected]> | |
Date: Tue, 19 Apr 2016 09:08:21 +0800 | |
Subject: [PATCH] Fix non-aligned memory access in ConvertAnyFormat | |
* Log indicated that the DOUBLE(Fmt=12) format was affected, | |
not sure if other formats are affected though. | |
Change-Id: I10b29bd54d350153fddd544e8a43711c2c48bb51 | |
--- | |
exif.c | 2 +- | |
1 file changed, 1 insertion(+), 1 deletion(-) | |
diff --git a/exif.c b/exif.c | |
index 8dfdaf1..fa9fd99 100644 | |
--- a/exif.c | |
+++ b/exif.c | |
@@ -453,7 +453,7 @@ double ConvertAnyFormat(void * ValuePtr, int Format) | |
// Not sure if this is correct (never seen float used in Exif format) | |
case FMT_SINGLE: Value = (double)*(float *)ValuePtr; break; | |
- case FMT_DOUBLE: Value = *(double *)ValuePtr; break; | |
+ case FMT_DOUBLE: memcpy(&Value, ValuePtr, sizeof(double));break; | |
default: | |
ErrNonfatal("Illegal format code %d",Format,0); | |
-- | |
2.1.4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
赞