decoder: fix mini object implementation on 64-bit systems.

Use GPOINTER_TO_SIZE() instead of GPOINTER_TO_UINT() while manipulating
pointers. The latter is meant to be 32-bit only, not uintptr_t like size.
Only a gsize can hold all bits of a pointer.

Thanks to Ouping Zhang for spotting this error.
This commit is contained in:
Gwenole Beauchesne 2013-01-10 10:12:25 +01:00
parent 0ecb3a627b
commit 591b637cfc

View file

@ -32,14 +32,14 @@ struct _GstVaapiMiniObjectBase {
static inline GstVaapiMiniObjectBase * static inline GstVaapiMiniObjectBase *
object2base(GstVaapiMiniObject *object) object2base(GstVaapiMiniObject *object)
{ {
return GUINT_TO_POINTER(GPOINTER_TO_UINT(object) - return GSIZE_TO_POINTER(GPOINTER_TO_SIZE(object) -
sizeof(GstVaapiMiniObjectBase)); sizeof(GstVaapiMiniObjectBase));
} }
static inline GstVaapiMiniObject * static inline GstVaapiMiniObject *
base2object(GstVaapiMiniObjectBase *base_object) base2object(GstVaapiMiniObjectBase *base_object)
{ {
return GUINT_TO_POINTER(GPOINTER_TO_UINT(base_object) + return GSIZE_TO_POINTER(GPOINTER_TO_SIZE(base_object) +
sizeof(GstVaapiMiniObjectBase)); sizeof(GstVaapiMiniObjectBase));
} }