Avoid crashing when setting the muxing delay early
authorJean-Marc Valin <jmvalin@jmvalin.ca>
Mon, 10 Jul 2017 17:10:28 +0000 (13:10 -0400)
committerJean-Marc Valin <jmvalin@jmvalin.ca>
Mon, 10 Jul 2017 17:10:28 +0000 (13:10 -0400)
src/opusenc.c

index 5af189e..1845af7 100644 (file)
@@ -834,7 +834,7 @@ int ope_encoder_ctl(OggOpusEnc *enc, int request, ...) {
         break;
       }
       enc->max_ogg_delay = value;
-      oggp_set_muxing_delay(enc->oggp, enc->max_ogg_delay);
+      if (enc->oggp) oggp_set_muxing_delay(enc->oggp, enc->max_ogg_delay);
     }
     break;
     case OPE_GET_MUXING_DELAY_REQUEST: