summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWim Taymans <wtaymans@redhat.com>2018-11-12 10:50:21 +0100
committerWim Taymans <wtaymans@redhat.com>2018-11-12 10:50:21 +0100
commit1ea84b2869d5506851ee4f52c98e16d14333b46d (patch)
tree508d7808de82e5bdfaa530951645b59b05a80d53
parent6f918561c905baa4fd3d0afd3d271bc60b2b35ea (diff)
spa: explicitly cast the offset to signed int
As reported by Marcello Blancasio, convert the offset to a signed int to avoid conversion without sign extension. Fixes unmap of stream memory. Fixes #103
-rw-r--r--spa/include/spa/utils/defs.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/spa/include/spa/utils/defs.h b/spa/include/spa/utils/defs.h
index e0ad462c..f955478b 100644
--- a/spa/include/spa/utils/defs.h
+++ b/spa/include/spa/utils/defs.h
@@ -86,7 +86,7 @@ struct spa_fraction {
_v > _high ? _high : ( _v < _low ? _low : _v); \
})
-#define SPA_MEMBER(b,o,t) ((t*)((uint8_t*)(b) + (o)))
+#define SPA_MEMBER(b,o,t) ((t*)((uint8_t*)(b) + (int)(o)))
#define SPA_CONTAINER_OF(p,t,m) (t*)((uint8_t*)p - offsetof (t,m))