Fix #111642: VSE glow code can overflow with small proxies #111660

Merged
Philipp Oeser merged 2 commits from lichtwerk/blender:111642 into main 2023-08-30 10:24:51 +02:00
1 changed files with 6 additions and 1 deletions

View File

@ -1980,6 +1980,12 @@ static void RVBlurBitmap2_float(float *map, int width, int height, float blur, i
return;
}
/* If result would be no blurring, early out. */
halfWidth = ((quality + 1) * blur);
if (halfWidth == 0) {
return;
}
/* Allocate memory for the temp-map and the blur filter matrix. */
temp = static_cast<float *>(MEM_mallocN(sizeof(float[4]) * width * height, "blurbitmaptemp"));
if (!temp) {
@ -1987,7 +1993,6 @@ static void RVBlurBitmap2_float(float *map, int width, int height, float blur, i
}
/* Allocate memory for the filter elements */
halfWidth = ((quality + 1) * blur);
filter = (float *)MEM_mallocN(sizeof(float) * halfWidth * 2, "blurbitmapfilter");
if (!filter) {
MEM_freeN(temp);