Fixes a crash on destroy with the pull API master v0.2.1
authorJean-Marc Valin <jmvalin@jmvalin.ca>
Sun, 7 Oct 2018 07:55:13 +0000 (03:55 -0400)
committerJean-Marc Valin <jmvalin@jmvalin.ca>
Sun, 7 Oct 2018 07:55:13 +0000 (03:55 -0400)
src/opusenc.c

index 5716f89..3e92ef1 100644 (file)
@@ -847,7 +847,7 @@ void ope_encoder_destroy(OggOpusEnc *enc) {
     EncStream *tmp = stream;
     stream = stream->next;
     /* Ignore any error on close. */
-    if (tmp->close_at_end) enc->callbacks.close(tmp->user_data);
+    if (tmp->close_at_end && !enc->pull_api) enc->callbacks.close(tmp->user_data);
     stream_destroy(tmp);
   }
   if (enc->chaining_keyframe) free(enc->chaining_keyframe);