mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
sdl: Fix heap smash in sdl_zoom_rgb{16,32} for int > 32 bits
Careless use of malloc(): allocate Uint32[N], assign to int *, use int[N]. Fix by converting to g_new(). Functions can't fail anymore, so make them return void. Caller ignored the value anyway. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
dabe3143e0
commit
cc69bda6c9
2 changed files with 10 additions and 15 deletions
|
@ -13,13 +13,14 @@
|
|||
|
||||
#include "sdl_zoom.h"
|
||||
#include "qemu/osdep.h"
|
||||
#include <glib.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
|
||||
static int sdl_zoom_rgb16(SDL_Surface *src, SDL_Surface *dst, int smooth,
|
||||
SDL_Rect *dst_rect);
|
||||
static int sdl_zoom_rgb32(SDL_Surface *src, SDL_Surface *dst, int smooth,
|
||||
SDL_Rect *dst_rect);
|
||||
static void sdl_zoom_rgb16(SDL_Surface *src, SDL_Surface *dst, int smooth,
|
||||
SDL_Rect *dst_rect);
|
||||
static void sdl_zoom_rgb32(SDL_Surface *src, SDL_Surface *dst, int smooth,
|
||||
SDL_Rect *dst_rect);
|
||||
|
||||
#define BPP 32
|
||||
#include "sdl_zoom_template.h"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue