fix: V-002 security vulnerability

Automated security fix generated by OrbisAI Security
This commit is contained in:
orbisai0security 2026-05-31 12:24:21 +00:00
parent d87bdfc917
commit 89262dafca

View file

@ -8,7 +8,9 @@ static void do_edge_boost(uint8_t *gray, int w, int h, void *ctx) {
int strength = ctx ? *(int *)ctx : 128;
// Unsharp mask: sharpened = original + (original - blurred) * strength
uint8_t *tmp = malloc(w * h);
if (h <= 0 || w <= 0)
return;
uint8_t *tmp = calloc((size_t)w, (size_t)h);
if (!tmp)
return;