Merge pull request #3569 from ihsinme/master

fix of an unattainable condition.
pull/3561/head
Kim Kulling 2021-01-06 16:00:46 +01:00 committed by GitHub
commit 53c03fa364
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 7 deletions

View File

@ -522,8 +522,7 @@ namespace o3dgc
buffer_size = max_code_bytes; // assign new memory
delete [] new_buffer; // free anything previously assigned
if ((new_buffer = new unsigned char[buffer_size+16]) == 0) // 16 extra bytes
AC_Error("cannot assign memory for compressed data buffer");
new_buffer = new unsigned char[buffer_size+16]; // 16 extra bytes
code_buffer = new_buffer; // set buffer for compressed data
}
@ -732,7 +731,6 @@ namespace o3dgc
table_size = table_shift = 0;
distribution = new unsigned[data_symbols];
}
if (distribution == 0) AC_Error("cannot assign model memory");
}
// compute cumulative distribution, decoder table
unsigned s = 0;
@ -803,7 +801,6 @@ namespace o3dgc
distribution = new unsigned[2*data_symbols];
}
symbol_count = distribution + data_symbols;
if (distribution == 0) AC_Error("cannot assign model memory");
}
reset(); // initialize model

View File

@ -527,9 +527,7 @@ char *OpenDDLParser::parseName(char *in, char *end, Name **name) {
in = parseIdentifier(in, end, &id);
if (id) {
currentName = new Name(ntype, id);
if (currentName) {
*name = currentName;
}
*name = currentName;
}
return in;