[FFmpeg-devel] Patch: fix ffplay segmentation fault
Benoit Fouet
benoit.fouet
Mon Mar 23 17:43:12 CET 2009
On 03/23/2009 04:52 PM, Michael Niedermayer wrote:
> On Mon, Mar 23, 2009 at 05:30:49PM +0800, avcoder wrote:
>
>> Dear:
>>
>> On Mon, Mar 23, 2009 at 4:58 PM, Reimar D?ffinger
>> <Reimar.Doeffinger at gmx.de> wrote:
>>
>>> On Mon, Mar 23, 2009 at 03:30:09PM +0800, avcoder wrote:
>>>
>>>> Dear:
>>>>
>>>> It seems that the recent swscale development has broken ffplay
>>>>
>>>> the following patch/hack will fix it
>>>>
>>>> Index: swscale.c
>>>> ===================================================================
>>>> --- swscale.c ??? 29040?
>>>> +++ swscale.c ??????
>>>> @@ -2120,7 +2120,7 @@
>>>> if (!dst[plane]) continue;
>>>> // ignore palette for GRAY8
>>>> if (plane == 1 && !dst[2]) continue;
>>>> - if (!src[plane] || (plane == 1 && !src[2]))
>>>> + if (dst[plane] && (!src[plane] || (plane == 1 && !src[2])))
>>>> fillPlane(dst[plane], dstStride[plane], length, height,
>>>> y, (plane==3) ? 255 : 128);
>>>> else
>>>> {
>>>>
>>> given the "if (!dst[plane]) continue;" above this can't be necessary.
>>>
>> Thanks!
>> I am silly
>>
>>
>>>> Index: ffplay.c
>>>> ===================================================================
>>>> --- ffplay.c ??? 18169?
>>>> +++ ffplay.c ??????
>>>> @@ -1242,6 +1242,7 @@
>>>> return -1;
>>>>
>>>> vp = &is->pictq[is->pictq_windex];
>>>> + memset(&pict,0,sizeof(AVPicture));
>>>>
>>>> /* alloc or resize hardware picture buffer */
>>>> if (!vp->bmp ||
>>>>
>>> The declaration and memset for pict should be moved into the if where it
>>> is used.
>>>
>> I update the patch according to your comment:
>>
>
> ok
>
> [...]
>
>
applied
Ben
More information about the ffmpeg-devel
mailing list