mirror of
https://github.com/ultravideo/uvg266.git
synced 2024-11-24 02:24:07 +00:00
Fix coverity warning.
- Dereferencing a pointer from realloc before checking if it's null.
This commit is contained in:
parent
cf2a406aba
commit
17bdc82b5e
|
@ -459,12 +459,13 @@ int encoder_state_init(encoder_state_t * const child_state, encoder_state_t * co
|
|||
|
||||
if (new_child) {
|
||||
child_state->children = realloc(child_state->children, sizeof(encoder_state_t) * (2+child_count));
|
||||
child_state->children[1+child_count].encoder_control = NULL;
|
||||
if (!child_state->children) {
|
||||
fprintf(stderr, "Failed to allocate memory for children...\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
child_state->children[1 + child_count].encoder_control = NULL;
|
||||
|
||||
//Fix children parent (since we changed the address), except for the last one which is not ready yet
|
||||
{
|
||||
int i, j;
|
||||
|
|
Loading…
Reference in a new issue