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 416b9c254e
commit b6f01542d8

View file

@ -106,7 +106,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))