[FFmpeg-devel] A patch for gdigrab function

Roger Pack rogerdpack2 at gmail.com
Tue Aug 19 15:44:53 CEST 2014


OK I was able to reproduce the problem.
Patch looks good, see attached, FWIW.
Thanks!
-roger-


On Sat, Aug 16, 2014 at 4:17 PM, Michael Niedermayer <michaelni at gmx.at>
wrote:

> On Fri, Aug 08, 2014 at 05:08:46PM +0800, hlszl1983 at 163.com wrote:
> > hi, all
> >
> > I'm using gdigrab feature on windows, and found that the count of gdi
> objects owned by ffmpeg.exe increasing endlessly...
> >
> > Here is the patch, can someone commit it?
> > ----------------------------------------------
> > diff --git a/libavdevice/gdigrab.c b/libavdevice/gdigrab.c
> > index bccfef2..e2bed14 100644
> > --- a/libavdevice/gdigrab.c
> > +++ b/libavdevice/gdigrab.c
> > @@ -451,6 +451,10 @@ static void paint_mouse_pointer(AVFormatContext
> *s1, struct gdigrab *gdigrab)
> > icon = CopyCursor(LoadCursor(NULL, IDC_ARROW));
> > }
> >
> > + /*Remarks
> > + *GetIconInfo creates bitmaps for the hbmMask and hbmColor members of
> ICONINFO.
> > + *The calling application must manage these bitmaps and delete them
> when they are no longer necessary.
> > + */
> > if (!GetIconInfo(icon, &info)) {
> > CURSOR_ERROR("Could not get icon info");
> > goto icon_error;
> > @@ -481,6 +485,10 @@ static void paint_mouse_pointer(AVFormatContext
> *s1, struct gdigrab *gdigrab)
> > }
> >
> > icon_error:
> > + if (info.hbmMask)
> > + DeleteObject(info.hbmMask);
> > + if(info.hbmColor)
> > + DeleteObject(info.hbmColor);
> > if (icon)
> > DestroyCursor(icon);
> > } else {
>
> the patch has been mangled, probably by your mail user agent
>
> also CC-ing maintainer
>
> [...]
> --
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> Old school: Use the lowest level language in which you can solve the
> problem
>             conveniently.
> New school: Use the highest level language in which the latest
> supercomputer
>             can solve the problem without the user falling asleep waiting.
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-gdigrab-fix-gdi-object-leak-if-using-mouse-based-on-.patch
Type: application/octet-stream
Size: 1187 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140819/7814af1f/attachment.obj>


More information about the ffmpeg-devel mailing list