Recently, I work on a video player program on Windows for a CCTV program. As the program has to decode and play many videos streams at the same time, I think it might meet
Always check, and pre-allocate a buffer that can be freed in this case so you can warn the user to save his data and shut down the application.