已开启
update: 更新文件 av_virtual_memory.cpp #2747
cgxcgxcgx创建于 8月22日
update: 更新文件 av_virtual_memory.cpp #2747
已开启
共 1 个文件变更+2-1
| @@ -13,6 +13,7 @@ | |||
| 13 | * limitations under the License. | 13 | * limitations under the License. |
| 14 | */ | 14 | */ |
| 15 | 15 | ||
| 16 | + | ||
| 16 | 17 | ||
| 17 | 18 | ||
| 18 | 19 | ||
| @@ -38,7 +39,7 @@ AVVirtualAllocator::AVVirtualAllocator(){}; | |||
| 38 | 39 | ||
| 39 | void *AVVirtualAllocator::Alloc(int32_t capacity) | 40 | void *AVVirtualAllocator::Alloc(int32_t capacity) |
| 40 | { | 41 | { |
| 41 | - uint8_t *ptr = new uint8_t[capacity]; | 42 | + uint8_t *ptr = new(std::nothrow) uint8_t[capacity]; |
| 42 | FALSE_RETURN_V_MSG_E(ptr != nullptr, nullptr, "Alloc memory failed, no memory"); | 43 | FALSE_RETURN_V_MSG_E(ptr != nullptr, nullptr, "Alloc memory failed, no memory"); |
| 43 | 44 | ||
| 44 | return static_cast<void *>(ptr); | 45 | return static_cast<void *>(ptr); |