On Fri, Dec 5, 2014 at 8:21 AM, Christophe Gisquet
<[email protected]> wrote:
> HuiHi,
>
> 2014-12-04 21:00 GMT+01:00 Nicolas Dufresne <[email protected]
>>:
>> av_fast_malloc() signature is void*, but this is just a convenience
>> not to have to cast. In fact it expect a pointer to pointer. This
>> fixes a crash on NULL pointer when playing back H263 Sorensen.
>>
>> Signed-off-by: Nicolas Dufresne <[email protected]>
>> ---
>> libavcodec/svq1dec.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/libavcodec/svq1dec.c b/libavcodec/svq1dec.c
>> index 14ff41c..13bbdd1 100644
>> --- a/libavcodec/svq1dec.c
>> +++ b/libavcodec/svq1dec.c
>> @@ -637,7 +637,7 @@ static int svq1_decode_frame(AVCodecContext *avctx,
> void *data,
>> return AVERROR_INVALIDDATA;
>> }
>>
>> - av_fast_malloc(s->pkt_swapped, &s->pkt_swapped_allocated,
>> + av_fast_malloc(&s->pkt_swapped, &s->pkt_swapped_allocated,
>> buf_size);
>> if (!s->pkt_swapped)
>> return AVERROR(ENOMEM);
>
> Isn't that (same patch context, different line numbers?) a subset of
> "[PATCH] svq1dec: Add padding, clear size, use the correct pointer"? If
> yes, I'd say the other is better.

The only difference is that the other patch zeroes the pointer on
deinit, which is not really required.
I prefer the Nicolas' patch as it offers more context and a wider
commit message.

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

Reply via email to