On 09/01/13 18:30, Anton Khirnov wrote:
> 
> On Wed, 09 Jan 2013 01:28:59 +0100, Luca Barbato <[email protected]> wrote:
>> On 08/01/13 15:35, Anton Khirnov wrote:
>>
>>> +    tmp = av_realloc(buf->buffer->data, size);
>>
>> This requires we fix av_realloc to always return aligned memory I guess.
>>
> 
> Not really. It just requires the code that does the reallocing to not need
> aligned memory.
> 

On 08/01/13 15:35, Anton Khirnov wrote:> +int
av_buffer_realloc(AVBufferRef **pbuf, int size)
> +{
> +    AVBufferRef *buf = *pbuf;
> +    uint8_t *tmp;
> +
> +    if (!buf) {
> +        *pbuf = av_buffer_alloc(size);

Does use av_malloc, thus memalign (posix or traditional flavor) in some
cases.

> +    tmp = av_realloc(buf->buffer->data, size);

Requires the pointer coming from an av_realloc() otherwise may crash and
burn on the whim of the implementor.

lu
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to