View Single Post
Old 05-09-09, 06:59 AM   #4
Mike Playle
Registered User
Join Date: Sep 2005
Posts: 26
Default Re: XvMC memory leak in 180.* / 185.* drivers

I've investigated this a bit further with the latest pre-release driver (180.53).

The leaked memory is being allocated in nv0032XvMCStatic which sends an X extension request and allocates 3 buffers to hold the reply. These 3 buffers get allocated every time round the loop, but they're only ever freed from nv0137XvMCstatic which is called from XvMCDestroySubpicture, XvMCDestroySurface and XvMCDestroyContext. So it looks to me like these buffers are meant to be allocated once only, the first time through, just like the outer context structure.

I found a possible uninitialised variable in nv0032XvMCStatic that looks like it might be relevant. If the local at offset 0x38 from the stack pointer is non-zero then nv0032XvMCStatic just returns success without allocating the 3 buffers. However I can't find anywhere in the function where this local gets initialised. Could this have anything to do with the leak?
Mike Playle is offline   Reply With Quote