[babl] base: half-float reference zero initialize lsb
- From: Øyvind Kolås <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [babl] base: half-float reference zero initialize lsb
- Date: Sat, 16 Jan 2016 18:42:11 +0000 (UTC)
commit 1d9e46419253420868515efe929e2c7f74798fc7
Author: Massimo Valentini <mvalentini src gnome org>
Date: Sat Jan 16 19:33:25 2016 +0100
base: half-float reference zero initialize lsb
babl/base/type-half.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/babl/base/type-half.c b/babl/base/type-half.c
index ac20ec9..5c0d079 100644
--- a/babl/base/type-half.c
+++ b/babl/base/type-half.c
@@ -138,6 +138,8 @@ static void halfp2doubles(void *target, void *source, long numel)
int32_t xes;
int e;
+ if (next)
+ *xp = 0;
xp += next; // Little Endian adjustment if necessary
if( source == NULL || target == NULL ) // Nothing to convert (e.g., imag part of pure real)
@@ -175,7 +177,9 @@ static void halfp2doubles(void *target, void *source, long numel)
*xp++ = (xs | xe | xm); // Combine sign bit, exponent bits, and mantissa bits
}
}
- *xp++ = 0; // Skip over and zero the remaining 32 bits of the mantissa
+ xp++; // Skip over and zero the remaining 32 bits of the mantissa
+ if (!next)
+ *xp = 0;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]