search for: celt_bad_arg

Displaying 2 results from an estimated 2 matches for "celt_bad_arg".

2011 Jan 29
2
Memory leak when specifying invalid channels count
...(channels < 0 || 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:...
2011 May 02
1
Modes?
...ist[i]->shortMdctSize*static_mode_list[i]->nbShortMdcts) { if (error) *error = CELT_OK; return (CELTMode*)static_mode_list[i]; } } } #endif /* CUSTOM_MODES_ONLY */ #ifndef CUSTOM_MODES if (error) *error = CELT_BAD_ARG; return NULL; #else -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.xiph.org/pipermail/opus/attachments/20110502/92d2c62b/attachment-0002.htm