openbsd-ports/www/firefox36/patches/patch-gfx_qcms_iccread_c
landry 17b63192b8 Resurrect www/firefox36 from the Attic, installing 3.6.16 in
${LOCALBASE}/firefox36 with firefox36 binary. Needed for archs
firefox 4 doesn't support (yet?). Yes, i'm looking at you sparc64.
Not yet linked to the build.
2011-03-26 10:58:36 +00:00

29 lines
885 B
Plaintext

$OpenBSD: patch-gfx_qcms_iccread_c,v 1.1 2011/03/26 10:58:36 landry Exp $
Fix crash on sparc64
https://bugzilla.mozilla.org/show_bug.cgi?id=629057
http://hg.mozilla.org/mozilla-central/rev/e8207773d54d
--- gfx/qcms/iccread.c.orig Fri Dec 3 16:48:03 2010
+++ gfx/qcms/iccread.c Thu Jan 27 23:43:43 2011
@@ -87,7 +87,9 @@ static uint32_t read_u32(struct mem_source *mem, size_
invalid_source(mem, "Invalid offset");
return 0;
} else {
- return be32_to_cpu(*(__be32*)(mem->buf + offset));
+ __be32 k;
+ memcpy(&k, mem->buf + offset, sizeof(__be32));
+ return be32_to_cpu(k);
}
}
@@ -97,7 +99,9 @@ static uint16_t read_u16(struct mem_source *mem, size_
invalid_source(mem, "Invalid offset");
return 0;
} else {
- return be16_to_cpu(*(__be16*)(mem->buf + offset));
+ __be16 k;
+ memcpy(&k, mem->buf + offset, sizeof(__be16));
+ return be16_to_cpu(k);
}
}