Hi<div><br></div><div>I minor issue I noticed when I passed an invalid 'channels' parameter to celt_encoder_create() is that celt_encoder_init() doesn't free the CELTEncoder ('st' parameter) when 'if (channels < 0 || channels > 2)' evaluates to true.</div>
<div><br></div><div>Seems celt_encoder_init() should do like this instead:</div><div><br></div><div><div>CELTEncoder *celt_encoder_init(CELTEncoder *st, const CELTMode *mode, int channels, int *error)</div><div>{</div><div>
if (channels < 0 || channels > 2)</div><div> {</div><div> if (error)</div><div> *error = CELT_BAD_ARG;</div><div> celt_free(st); /* ensure 'st' is deallocated */</div><div> return NULL;</div>
<div> }</div></div><div><br></div><div><br></div><div>Or maybe even better have celt_encoder_init() allocate the CELTEncoder so it's only created if the input is valid.</div><div><br></div><div>-- Bjoern</div><div><br>
</div>