HEAP corruption any time I delete a picture pool (picture_pool_Delete)
Posted: 17 Sep 2015 22:30
I have to do some custom rendering stuff on windows. So, I created a new plugin. I am using VLC for windows (2.2.1). I am using the provided include files.
I created a new direct3d rendering project that is an exact copy of the direct3d provided in the VLC source for 2.2.0 (on GitHub). I had to message a few lines of code due to visual studio lacking some of the newer c++ features, but in the end, I got it working. I can now play using my custom plugin, and the video behaves exactly the same as the default direct3d plugin, EXCEPT, I get an error when the video is finished rendering (play stopped). After inspection, the exception was raised when calling "picture_pool_Delete".
I cannot delete a picture pool. I don't think this is related to my plugin per-say. It just seems to be an issue with the VLC api on windows. The following code reproduces the issue.
The exception being thrown is...
Any ideas as to why I can't free a picture pool on Windows?
I created a new direct3d rendering project that is an exact copy of the direct3d provided in the VLC source for 2.2.0 (on GitHub). I had to message a few lines of code due to visual studio lacking some of the newer c++ features, but in the end, I got it working. I can now play using my custom plugin, and the video behaves exactly the same as the default direct3d plugin, EXCEPT, I get an error when the video is finished rendering (play stopped). After inspection, the exception was raised when calling "picture_pool_Delete".
I cannot delete a picture pool. I don't think this is related to my plugin per-say. It just seems to be an issue with the VLC api on windows. The following code reproduces the issue.
Code: Select all
picture_pool_configuration_t pool_cfg;
memset(&pool_cfg, 0, sizeof(pool_cfg));
pool_cfg.picture_count = 1;
pool_cfg.picture = &picture;
pool_cfg.lock = Direct3DLockSurface;
pool_cfg.unlock = Direct3DUnlockSurface;
sys->pool = picture_pool_NewExtended(&pool_cfg);
if (!sys->pool) {
picture_Release(picture);
IDirect3DSurface9_Release(surface);
return VLC_ENOMEM;
}
// freeing the pool throws a heap violation!
// TEST: BEGIN
picture_pool_Delete(sys->pool);
sys->pool == NULL;
// TEST: END
Code: Select all
Unhandled exception at 0x779F5624 (ntdll.dll) in HDMDWide.exe: 0xC0000374: A heap has been corrupted (parameters: 0x77A11378).