mirror of
https://github.com/yuzu-emu/breakpad.git
synced 2024-12-23 10:05:37 +00:00
Fix assertion failure in WriteMappings() for zero modules
If there were no mappings where ShouldIncludeMapping() returned true, AllocateObjectAndArray() would die with an assertion failure. BUG=chrome-os-partner:14914 TEST=Ran unittests Review URL: https://breakpad.appspot.com/492002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1081 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
parent
bbcdd7711f
commit
1b75bf9f8a
|
@ -834,8 +834,15 @@ class MinidumpWriter {
|
|||
}
|
||||
|
||||
TypedMDRVA<uint32_t> list(&minidump_writer_);
|
||||
if (num_output_mappings) {
|
||||
if (!list.AllocateObjectAndArray(num_output_mappings, MD_MODULE_SIZE))
|
||||
return false;
|
||||
} else {
|
||||
// Still create the module list stream, although it will have zero
|
||||
// modules.
|
||||
if (!list.Allocate())
|
||||
return false;
|
||||
}
|
||||
|
||||
dirent->stream_type = MD_MODULE_LIST_STREAM;
|
||||
dirent->location = list.location();
|
||||
|
|
Loading…
Reference in a new issue