Skip to content

Commit

Permalink
Fix plutovg misaligned address
Browse files Browse the repository at this point in the history
  • Loading branch information
sammycage committed Nov 18, 2022
1 parent 56ddf2a commit 3881f34
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions 3rdparty/plutovg/plutovg-rle.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@
#include <math.h>
#include <limits.h>

#define ALIGN_SIZE(size) (((size) + 7ul) & ~7ul)
static void ft_outline_init(PVG_FT_Outline* outline, plutovg_t* pluto, int points, int contours)
{
size_t size_a = (points + contours) * sizeof(PVG_FT_Vector);
size_t size_b = (points + contours) * sizeof(char);
size_t size_c = contours * sizeof(int);
size_t size_d = contours * sizeof(char);
size_t size_a = ALIGN_SIZE((points + contours) * sizeof(PVG_FT_Vector));
size_t size_b = ALIGN_SIZE((points + contours) * sizeof(char));
size_t size_c = ALIGN_SIZE(contours * sizeof(int));
size_t size_d = ALIGN_SIZE(contours * sizeof(char));
size_t size_n = size_a + size_b + size_c + size_d;
if(size_n > pluto->outline_size) {
pluto->outline_data = realloc(pluto->outline_data, size_n);
Expand Down

0 comments on commit 3881f34

Please sign in to comment.