[FFmpeg-trac] #3835(avdevice:new): The count of gdi objects owned by ffmpeg.exe increasing endlessly on windows

FFmpeg trac at avcodec.org
Fri Aug 8 09:04:08 CEST 2014


#3835: The count of gdi objects owned by ffmpeg.exe increasing endlessly on
windows
-------------------------------------+-------------------------------------
             Reporter:  hlszl        |                     Type:  defect
               Status:  new          |                 Priority:  normal
            Component:  avdevice     |                  Version:
             Keywords:  gdigrab      |  unspecified
  windows                            |               Blocked By:
             Blocking:               |  Reproduced by developer:  1
Analyzed by developer:  1            |
-------------------------------------+-------------------------------------
 Summary of the bug:
 using gdigrab feature on windows, and found that the count of gdi objects
 owned by ffmpeg.exe increasing endlessly...

 cause:
 code in function paint_mouse_pointer(...) of gdigrab.c

       if (!GetIconInfo(icon, &info)) {
             CURSOR_ERROR("Could not get icon info");
             goto icon_error;
         }

  /*Remarks from msdn
    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.
  */

 but there are NO release for these two object in code for now!

 bug fix:
 please add code as below in function paint_mouse_pointer(...)  :
 ...
 icon_error:
          if (info.hbmMask)
             DeleteObject(info.hbmMask);
         if(info.hbmColor)
             DeleteObject(info.hbmColor);
          if (icon)
             DestroyCursor(icon);
 ...

--
Ticket URL: <https://trac.ffmpeg.org/ticket/3835>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list