[Ffmpeg-devel] [PATCH] fix for gray16le segfault in imgconvert

Michael Niedermayer michaelni
Sat Apr 7 19:20:46 CEST 2007


Hi

On Sat, Apr 07, 2007 at 07:15:38PM +0200, Ivo wrote:
> On Saturday 07 April 2007 18:58, Michael Niedermayer wrote:
> > On Sat, Apr 07, 2007 at 06:47:17PM +0200, Ivo wrote:
> > >  static void gray16le_to_gray(AVPicture *dst, const AVPicture *src,
> > >                                int width, int height)
> > >  {
> > > -    gray16_to_gray(dst, src + 1, width, height);
> > > +    AVPicture *tmpsrc = (AVPicture *) src;
> > > +    tmpsrc->data[0]++;
> >
> > no
> 
> Third try.
> Index: libavcodec/imgconvert.c
> ===================================================================
> --- libavcodec/imgconvert.c	(revision 8631)
> +++ libavcodec/imgconvert.c	(working copy)
> @@ -1886,7 +1886,10 @@
>  static void gray16le_to_gray(AVPicture *dst, const AVPicture *src,
>                                int width, int height)
>  {
> -    gray16_to_gray(dst, src + 1, width, height);
> +    AVPicture tmpsrc;
> +    memcpy(&tmpsrc, src, sizeof(AVPicture));
> +    tmpsrc.data[0]++;
> +    gray16_to_gray(dst, &tmpsrc, width, height);
>  }

AVPicture tmpsrc= *src;

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

If you really think that XML is the answer, then you definitly missunderstood
the question -- Attila Kinali
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070407/fa60f043/attachment.pgp>



More information about the ffmpeg-devel mailing list