mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
fix occasional crash in PNMImage::quick_filter_from()
This commit is contained in:
parent
a757cb47e8
commit
603f0eb3b1
@ -696,7 +696,7 @@ box_filter_line(const PNMImage &image,
|
|||||||
|
|
||||||
// Get the final (partial) xel
|
// Get the final (partial) xel
|
||||||
float x_contrib = x1 - (float)x_last;
|
float x_contrib = x1 - (float)x_last;
|
||||||
if (x_contrib > 0.0001f) {
|
if (x_contrib > 0.0001f && x < image.get_x_size()) {
|
||||||
box_filter_xel(image, x, y, x_contrib, y_contrib,
|
box_filter_xel(image, x, y, x_contrib, y_contrib,
|
||||||
color, pixel_count);
|
color, pixel_count);
|
||||||
}
|
}
|
||||||
@ -728,7 +728,7 @@ box_filter_region(const PNMImage &image,
|
|||||||
|
|
||||||
// Get the final (partial) row
|
// Get the final (partial) row
|
||||||
float y_contrib = y1 - (float)y_last;
|
float y_contrib = y1 - (float)y_last;
|
||||||
if (y_contrib > 0.0001f) {
|
if (y_contrib > 0.0001f && y < image.get_y_size()) {
|
||||||
box_filter_line(image, x0, y, x1, y_contrib,
|
box_filter_line(image, x0, y, x1, y_contrib,
|
||||||
color, pixel_count);
|
color, pixel_count);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user