On Fri, Dec 5, 2014 at 3:48 AM, Vittorio Giovara
<vittorio.giov...@gmail.com> wrote:
> On Fri, Dec 5, 2014 at 8:21 AM, Christophe Gisquet
> <christophe.gisq...@gmail.com> wrote:
>> HuiHi,
>>
>> 2014-12-04 21:00 GMT+01:00 Nicolas Dufresne <nicolas.dufre...@collabora.com
>>>:
>>> 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 <nicolas.dufre...@collabora.com>
>>> ---
>>> 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.

It also uses padded malloc.

Timothy
_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to