diff --git a/src/bitmap.cpp b/src/bitmap.cpp index cec61bb..a8d2aab 100644 --- a/src/bitmap.cpp +++ b/src/bitmap.cpp @@ -914,7 +914,8 @@ Color Bitmap::getPixel(int x, int y) const if (x < 0 || y < 0 || x >= width() || y >= height()) return Vec4(); - p->downloadToSurface(); + if (!p->surface) + p->downloadToSurface(); uint32_t pixel = getPixelAt(p->surface, p->format, x, y);