mirror of
https://github.com/xiph/opus.git
synced 2025-06-03 09:07:42 +00:00
Wrapping all allocation within opus_alloc() and opus_free()
This commit is contained in:
parent
4a4a546440
commit
07f884042e
11 changed files with 55 additions and 53 deletions
|
@ -35,6 +35,7 @@
|
|||
|
||||
#include "opus.h"
|
||||
#include "opus_private.h"
|
||||
#include "os_support.h"
|
||||
|
||||
struct OpusRepacketizer {
|
||||
unsigned char toc;
|
||||
|
@ -59,12 +60,12 @@ OpusRepacketizer *opus_repacketizer_init(OpusRepacketizer *rp)
|
|||
|
||||
OpusRepacketizer *opus_repacketizer_create(void)
|
||||
{
|
||||
return opus_repacketizer_init(malloc(opus_repacketizer_get_size()));
|
||||
return opus_repacketizer_init(opus_alloc(opus_repacketizer_get_size()));
|
||||
}
|
||||
|
||||
void opus_repacketizer_destroy(OpusRepacketizer *rp)
|
||||
{
|
||||
free(rp);
|
||||
opus_free(rp);
|
||||
}
|
||||
|
||||
int opus_repacketizer_cat(OpusRepacketizer *rp, const unsigned char *data, int len)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue