GRAPHICS: Fix segmentation fault for thumbnail from incomplete fill
Common::fill fills up to but not including the address of the last item Previously the last item of array v was not filled with 0, so if the rest of the code in the scaleLine() method did not update it, it would have a random init value which could cause segmentation fault when using the scale() method.
This commit is contained in:
parent
a5068eb9b0
commit
7d6a8fe7bb
1 changed files with 1 additions and 1 deletions
|
@ -279,7 +279,7 @@ int *scaleLine(int size, int srcSize) {
|
|||
int scale = 100 * size / srcSize;
|
||||
assert(scale > 0);
|
||||
int *v = new int[size];
|
||||
Common::fill(v, &v[size - 1], 0);
|
||||
Common::fill(v, v + size, 0);
|
||||
|
||||
int distCtr = 0;
|
||||
int *destP = v;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue