]> git.sesse.net Git - vlc/blobdiff - modules/video_output/msw/direct2d.c
Wayland/shell: fix NULL dereference in pathological case
[vlc] / modules / video_output / msw / direct2d.c
index 115a6d5ecade8d186adc5b0b1b9e6a1148b59c33..e758afd4632007da2f89dcd8a196d4bc30f5110f 100644 (file)
@@ -6,19 +6,19 @@
  *
  * Author: David Kaplan <david@2of1.org>
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 of the License, or
  * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
 /*****************************************************************************
 
 #include <vlc_common.h>
 #include <vlc_plugin.h>
-#include <vlc_playlist.h>
 #include <vlc_vout_display.h>
 
 #include <windows.h>
 #include <commctrl.h>
-
+#include <initguid.h>
 #include <d2d1.h>
 
 #include "common.h"
 
-#include <initguid.h>
-#undef GUID_EXT
-#define GUID_EXT
-DEFINE_GUID(IID_ID2D1Factory, 0x6152247, 0x6f50, 0x465a, 0x92, 0x45, 0x11, 0x8b, 0xfd, 0x3b, 0x60, 0x7);
 
 /*****************************************************************************
  * Module descriptor
@@ -110,7 +105,7 @@ static int Open(vlc_object_t *object)
                                         void **);
 
     D2D1CreateFactory = (void *)GetProcAddress(sys->d2_dll,
-                                               TEXT("D2D1CreateFactory"));
+                                               "D2D1CreateFactory");
     if (!D2D1CreateFactory) {
         msg_Err(vd,
                 "Cannot locate reference to a D2D1CreateFactory ABI in D2D1.DLL");
@@ -351,8 +346,8 @@ static int D2D_CreateRenderTarget(vout_display_t *vd)
     };
 
     D2D1_SIZE_U bitmap_size = {
-        vd->fmt.i_width,
-        vd->fmt.i_height
+        vd->fmt.i_visible_width,
+        vd->fmt.i_visible_height
     };
 
     hr = ID2D1HwndRenderTarget_CreateBitmap(sys->d2_render_target,