Ver código fonte

Fix heap corruption in malloc

Use SDL's malloc functions in abstractions.
master
TheoryOfNekomata 1 ano atrás
pai
commit
8c9e34b691
2 arquivos alterados com 4 adições e 4 exclusões
  1. +3
    -3
      src/packages/stdinc/IZ_stdlib.c
  2. +1
    -1
      src/packages/stdinc/IZ_stdlib.h

+ 3
- 3
src/packages/stdinc/IZ_stdlib.c Ver arquivo

@@ -1,13 +1,13 @@
#include "IZ_stdlib.h"

void* IZ_malloc(size_t size) {
return malloc(size);
return SDL_malloc(size);
}

void* IZ_calloc(unsigned int count, size_t size) {
return calloc(count, size);
return SDL_calloc(count, size);
}

void IZ_free(void* p) {
free(p);
SDL_free(p);
}

+ 1
- 1
src/packages/stdinc/IZ_stdlib.h Ver arquivo

@@ -1,7 +1,7 @@
#ifndef IZ_STDLIB_H
#define IZ_STDLIB_H

#include <stdlib.h>
#include <SDL_stdinc.h>

void* IZ_malloc(size_t);
void* IZ_calloc(unsigned int, size_t);


Carregando…
Cancelar
Salvar