shithub: libopusenc

Download patch

ref: e7ce79de64e982fcf25162de16609e5d380a60b7
parent: ac6b2112da610f474389a53628d86c545821fe69
author: Dragos Oancea <dragos.oancea@nexmo.com>
date: Mon Jul 24 15:01:18 EDT 2017

some extra checks to avoid crashing

(modified by Jean-Marc Valin)

Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>

--- a/src/opusenc.c
+++ b/src/opusenc.c
@@ -368,7 +368,7 @@
 /* Create a new OggOpus stream, pulling one page at a time. */
 OPE_EXPORT OggOpusEnc *ope_encoder_create_pull(OggOpusComments *comments, opus_int32 rate, int channels, int family, int *error) {
   OggOpusEnc *enc = ope_encoder_create_callbacks(NULL, NULL, comments, rate, channels, family, error);
-  enc->pull_api = 1;
+  if (enc) enc->pull_api = 1;
   return enc;
 }