[FFmpeg-devel] [PATCH 2/3] lavc: add av_fast_padded_mallocz

Paul B Mahol onemda at gmail.com
Tue Jul 10 16:46:05 CEST 2012


On 7/10/12, Reimar Doeffinger <Reimar.Doeffinger at gmx.de> wrote:
>
>
> On 10 Jul 2012, at 05:53, Paul B Mahol <onemda at gmail.com> wrote:
>
>> Signed-off-by: Paul B Mahol <onemda at gmail.com>
>> ---
>> libavcodec/avcodec.h |    6 ++++++
>> libavcodec/utils.c   |   12 ++++++++++++
>> 2 files changed, 18 insertions(+), 0 deletions(-)
>>
>> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
>> index c850963..80bd75e 100644
>> --- a/libavcodec/avcodec.h
>> +++ b/libavcodec/avcodec.h
>> @@ -4602,6 +4602,12 @@ void av_fast_malloc(void *ptr, unsigned int *size,
>> size_t min_size);
>> void av_fast_padded_malloc(void *ptr, unsigned int *size, size_t
>> min_size);
>>
>> /**
>> + * Same behaviour av_fast_padded_malloc except that buffer will always
>> + * be 0-initialized after call.
>
> Huh? I don't think that's what it does, it does not always initialize to 0,
> also I think it misses a check for allocation failure.

You are wrong in both cases.


More information about the ffmpeg-devel mailing list