From 1ea84b2869d5506851ee4f52c98e16d14333b46d Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 12 Nov 2018 10:50:21 +0100 Subject: [PATCH] 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 --- spa/include/spa/utils/defs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spa/include/spa/utils/defs.h b/spa/include/spa/utils/defs.h index e0ad462c8..f955478b7 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))