Handle malloc failure in mode_create gracefully without leaking memory.
This commit is contained in:
parent
1716999bbe
commit
dc67fa9a4c
6 changed files with 122 additions and 21 deletions
|
@ -104,6 +104,8 @@ int *quant_prob_alloc(const CELTMode *m)
|
|||
int i;
|
||||
int *prob;
|
||||
prob = celt_alloc(4*m->nbEBands*sizeof(int));
|
||||
if (prob==NULL)
|
||||
return NULL;
|
||||
for (i=0;i<m->nbEBands;i++)
|
||||
{
|
||||
prob[2*i] = 6000-i*200;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue