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
This commit is contained in:
Wim Taymans 2018-11-12 10:50:21 +01:00
parent 6f918561c9
commit 1ea84b2869

View file

@ -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))