[FFmpeg-devel] Patch: fix ffplay segmentation fault

Michael Niedermayer michaelni
Mon Mar 23 16:52:19 CET 2009


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

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Awnsering whenever a program halts or runs forever is
On a turing machine, in general impossible (turings halting problem).
On any real computer, always possible as a real computer has a finite number
of states N, and will either halt in less than N cycles or never halt.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090323/012b960d/attachment.pgp>



More information about the ffmpeg-devel mailing list