Matroska-Org / libmatroska

a C++ libary to parse Matroska files (.mkv and .mka)
GNU Lesser General Public License v2.1
318 stars 57 forks source link

[1.x] catch the DataBuffer allocation failure #109

Closed robUx4 closed 1 year ago

robUx4 commented 1 year ago

Using std::nothrow in a header risks breaking when included from a project that defines new to a different signature.

For example projects using a special version of new on Windows to detect memory leaks: https://learn.microsoft.com/en-us/cpp/c-runtime-library/find-memory-leaks-using-the-crt-library

(cherry picked from 16f06258157c9df4b521a6af49db45b1ea93cec0)

Backport of #108 into the 1.x branch