Displaying 1 result from an estimated 1 matches for "celt_free".
2011 Jan 29
2
Memory leak when specifying invalid channels count
...channels > 2)'
evaluates to true.
Seems celt_encoder_init() should do like this instead:
CELTEncoder *celt_encoder_init(CELTEncoder *st, const CELTMode *mode, int
channels, int *error)
{
if (channels < 0 || channels > 2)
{
if (error)
*error = CELT_BAD_ARG;
celt_free(st); /* ensure 'st' is deallocated */
return NULL;
}
Or maybe even better have celt_encoder_init() allocate the CELTEncoder so
it's only created if the input is valid.
-- Bjoern
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.xiph...