[FFmpeg-devel] [PATCH] IFF: Fix IFF decoder crash with enabled avfilter

Sebastian Vater cdgs.basty
Wed May 26 14:31:32 CEST 2010


Ronald S. Bultje a ?crit :
> Hi,
>
> On Sun, May 23, 2010 at 12:41 PM, Sebastian Vater
> <cdgs.basty at googlemail.com> wrote:
>   
>> Finally, the IFF decoder works also with enabled libavfilter.
>>
>> I just tried out this patch with all images and they work like a charm.
>>
>> I did this by moving get_buffer call in decode_init to both decode_frame
>> parts (replacing the reget_buffers there).
>>
>> Also I had to move ff_read_cmap_palette from decode_init to decode_frame
>> also since that relies on get_buffer already called.
>>
>> So here's the very small patch to review. :)
>>     
> [..]
>   
>> -    if (avctx->reget_buffer(avctx, &s->frame) < 0){
>> +    if ((res = avctx->get_buffer(avctx, &s->frame) < 0)) {
>>          av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
>> -        return -1;
>> +        return res;
>> +    } else if (avctx->bits_per_coded_sample <= 8 && avctx->pix_fmt != PIX_FMT_GRAY8) {
>> +        if ((res = ff_cmap_read_palette(avctx, (uint32_t*)s->frame.data[1])) < 0)
>> +            return res;
>>      }
>>     
>
> You don't want to do this every time, right? Shouldn't there be some
> s->init variable or so, so you do this only once?
>   

Yes, you're right.
Fixed!

-- 

Best regards,
                   :-) Basty/CDGS (-:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: iff-avfilter-crash-fix.patch
Type: text/x-diff
Size: 2919 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100526/b44686a6/attachment.patch>



More information about the ffmpeg-devel mailing list