Commit 756c7595 authored by Gregory Maxwell's avatar Gregory Maxwell Committed by Jean-Marc Valin
Browse files

Make opus_repacketizer_create handle malloc failure gracefully.

parent a9b864b8
......@@ -56,7 +56,10 @@ OpusRepacketizer *opus_repacketizer_init(OpusRepacketizer *rp)
OpusRepacketizer *opus_repacketizer_create(void)
return opus_repacketizer_init((OpusRepacketizer *)opus_alloc(opus_repacketizer_get_size()));
OpusRepacketizer *rp;
rp=(OpusRepacketizer *)opus_alloc(opus_repacketizer_get_size());
if(rp==NULL)return NULL;
return opus_repacketizer_init(rp);
void opus_repacketizer_destroy(OpusRepacketizer *rp)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment