فهرست منبع

Fixed warning C6263: Using _alloca in a loop: this can quickly overflow stack.

Sam Lantinga 1 سال پیش
والد
کامیت
c9b243fb56
1فایلهای تغییر یافته به همراه2 افزوده شده و 3 حذف شده
  1. 2 3
      src/video/windows/SDL_windowsevents.c

+ 2 - 3
src/video/windows/SDL_windowsevents.c

@@ -1288,16 +1288,15 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
         HDROP drop = (HDROP)wParam;
         UINT count = DragQueryFile(drop, 0xFFFFFFFF, NULL, 0);
         for (i = 0; i < count; ++i) {
-            SDL_bool isstack;
             UINT size = DragQueryFile(drop, i, NULL, 0) + 1;
-            LPTSTR buffer = SDL_small_alloc(TCHAR, size, &isstack);
+            LPTSTR buffer = (LPTSTR)SDL_malloc(sizeof(TCHAR) * size);
             if (buffer) {
                 if (DragQueryFile(drop, i, buffer, size)) {
                     char *file = WIN_StringToUTF8(buffer);
                     SDL_SendDropFile(data->window, NULL, file);
                     SDL_free(file);
                 }
-                SDL_small_free(buffer, isstack);
+                SDL_free(buffer);
             }
         }
         SDL_SendDropComplete(data->window);