aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcus Meissner <meissner@suse.de>2012-05-07 18:41:42 +0800
committerDaniel Veillard <veillard@redhat.com>2012-05-07 18:41:42 +0800
commit996449273fd4a8fc656d42088779e236d456e47a (patch)
tree3639f73aa992c962a312fb32c444c1fb509fda26
parent40db1eeb3637af933fca491dfc90c25c31e6e05e (diff)
downloadandroid_external_libxml2-996449273fd4a8fc656d42088779e236d456e47a.tar.gz
android_external_libxml2-996449273fd4a8fc656d42088779e236d456e47a.tar.bz2
android_external_libxml2-996449273fd4a8fc656d42088779e236d456e47a.zip
fixed a 64bit big endian issue
For https://bugzilla.gnome.org/show_bug.cgi?id=671176 patch fixes a 64bit endian issue, making libxml2 work (again) on ppc64 unsigned int and size_t are differently sized on 64bit.
-rw-r--r--xzlib.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/xzlib.c b/xzlib.c
index f9f16fc3..f1f50e56 100644
--- a/xzlib.c
+++ b/xzlib.c
@@ -229,9 +229,14 @@ xz_avail(xz_statep state)
if (state->err != LZMA_OK)
return -1;
if (state->eof == 0) {
- if (xz_load(state, state->in, state->size,
- (unsigned int *) &(strm->avail_in)) == -1)
+ /* avail_in is size_t, which is not necessary sizeof(unsigned) */
+ unsigned tmp = strm->avail_in;
+
+ if (xz_load(state, state->in, state->size, &tmp) == -1) {
+ strm->avail_in = tmp;
return -1;
+ }
+ strm->avail_in = tmp;
strm->next_in = state->in;
}
return 0;