[FFmpeg-devel] [PATCH v3] Added Turing codec interface for ffmpeg

James Almer jamrial at gmail.com
Tue Dec 6 16:35:49 EET 2016


On 12/6/2016 11:03 AM, wm4 wrote:
>> +static void add_option(const char* current_option, optionContext* option_ctx)
>> +{
>> +    int option_length = strlen(current_option);
>> +    if (option_ctx->buffer_filled + option_length + 1 > option_ctx->options_buffer_size) {
>> +        option_ctx->options_buffer_size += option_length + 1;
>> +        option_ctx->options = realloc(option_ctx->options, option_ctx->options_buffer_size);
> Missing error handling, and maybe overflow handling. Also, we don't use
> malloc/realloc/free, but av_malloc/av_realloc/av_free. I'm not sure why
> we do this (it doesn't have much of a justification for realloc at
> least), but it's probably better to be consistent.

av_realloc() and av_realloc_array() will call _aligned_realloc() on windows
instead of realloc().
There's also the memalign_hack codepath, but that's scheduled to go anyway.

> 
> Does the "s" field have any purpose? It seems to be redundant with the
> other fields.
> 



More information about the ffmpeg-devel mailing list