XvMC allocation fixes From: Daniel Drake Users at https://bugs.gentoo.org/show_bug.cgi?id=228473 report problems using software such as MythTV: ViaXvMC: Could not allocate timestamp blit area. 2008-06-20 11:25:39.231 VideoOutputXv Error: Unable to create XvMC Context, status(11): BadAlloc 2008-06-20 11:25:39.233 VideoOutputXv Error: Could not open XvMC port... We tracked this down to a bug in the libxvmc code, which does not pass the right structure size to the ioctl: it calls sizeof() on a pointer I also audited all the other ioctls and did not find any other occurences of this error. Index: /trunk/libxvmc/viaLowLevelPro.c =================================================================== --- /trunk/libxvmc/viaLowLevelPro.c (revision 415) +++ /trunk/libxvmc/viaLowLevelPro.c (revision 694) @@ -1461,5 +1461,5 @@ if (size != mem->size) { if (mem->size) - drmCommandWrite(xl->fd, DRM_VIA_FREEMEM, mem, sizeof(mem)); + drmCommandWrite(xl->fd, DRM_VIA_FREEMEM, mem, sizeof(*mem)); mem->context = *(xl->drmcontext); mem->size = size; @@ -1467,5 +1467,5 @@ if (((ret = drmCommandWriteRead(xl->fd, DRM_VIA_ALLOCMEM, mem, - sizeof(mem))) < 0) || mem->size != size) { + sizeof(*mem))) < 0) || mem->size != size) { mem->size = 0; return -1; @@ -1485,5 +1485,5 @@ if (mem->size) - drmCommandWrite(xl->fd, DRM_VIA_FREEMEM, mem, sizeof(mem)); + drmCommandWrite(xl->fd, DRM_VIA_FREEMEM, mem, sizeof(*mem)); mem->size = 0; }