ShiftMediaProject / x264

Unofficial X264 with added custom native Visual Studio project build tools. X264: A free software library and application for encoding video streams into the H.264/MPEG-4 AVC format.

Home Page:http://www.videolan.org/developers/x264.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

malloc() failure

JPGygax68 opened this issue · comments

libx264' malloc() fails during initialization of the codec (i.e. inside the call to avcodec_open2() ). The Visual Studio memory graph shows that the process is using roughly 1GB at that time, so there should be plenty to spare.
Is this / has this been known to happen? (My ShiftMediaProject build is about 2 months old; the codebase did not build one or two weeks ago, but I didn't try too hard.)

This is the first ive ever seen of this. You can try the current version in the repository and if that doesnt work youll have to post more detailed information.

I've rebuilt FFmpeg from the current sources and the problem remains. I no longer think it is directly related to x264 though, because I get other error messages stemming from low memory. This is very strange, considering that the process uses less than 1GB of memory. It's a 32-bit EXE, which afaik means it is limited to about 2GB (the laptop itself has 24GB), but that is still way off.

Feel free to close this issue; and if you happen to have an idea of what might be causing this behaviour, I'd be grateful.

If its failing just performing a basic malloc operation then thats a rather hard one to solve. As malloc is part of the compiler libs and interacts directly with the system then its not one of those things you can control.
That said you should check the error VS is giving you as sometimes it will error on the first malloc/free that occurs after some form of memory corruption. However if the error is purely not enough memory then thats purely the OS not allocating anything. In which case just check how much the program is trying to allocate at the time it fails as it might be trying to allocate several GB of memory or something (which would cause it to go outside the 32bit limitations). You can always change to 64bit and see if that helps (which is easy to do with ffmpeg but it depends on how easy it is in your code).