diff options
author | Wim Taymans <wtaymans@redhat.com> | 2018-11-12 10:50:21 +0100 |
---|---|---|
committer | Wim Taymans <wtaymans@redhat.com> | 2018-11-12 10:50:21 +0100 |
commit | 1ea84b2869d5506851ee4f52c98e16d14333b46d (patch) | |
tree | 508d7808de82e5bdfaa530951645b59b05a80d53 | |
parent | 6f918561c905baa4fd3d0afd3d271bc60b2b35ea (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.h | 2 |
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)) |