Bladeren bron

libpipi: fix a buffer underallocation.

git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/libpipi/trunk@2943 92316355-f0b4-4df1-b90c-862c8a59935f
remotes/tiles
sam 16 jaren geleden
bovenliggende
commit
a63c525fb7
1 gewijzigde bestanden met toevoegingen van 4 en 4 verwijderingen
  1. +4
    -4
      pipi/codec/oric.c

+ 4
- 4
pipi/codec/oric.c Bestand weergeven

@@ -529,11 +529,11 @@ static void write_screen(float const *data, uint8_t *screen)


stride = (WIDTH + 1) * 3; stride = (WIDTH + 1) * 3;


src = malloc((WIDTH + 1) * (HEIGHT + 1) * 3); src = malloc((WIDTH + 1) * (HEIGHT + 1) * 3 * sizeof(int));
memset(src, 0, (WIDTH + 1) * (HEIGHT + 1) * 3); memset(src, 0, (WIDTH + 1) * (HEIGHT + 1) * 3 * sizeof(int));


dst = malloc((WIDTH + 1) * (HEIGHT + 1) * 3); dst = malloc((WIDTH + 1) * (HEIGHT + 1) * 3 * sizeof(int));
memset(dst, 0, (WIDTH + 1) * (HEIGHT + 1) * 3); memset(dst, 0, (WIDTH + 1) * (HEIGHT + 1) * 3 * sizeof(int));


/* Import pixels into our custom format */ /* Import pixels into our custom format */
for(y = 0; y < HEIGHT; y++) for(y = 0; y < HEIGHT; y++)


||||||
x
 
000:0
Laden…
Annuleren
Opslaan