summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Fl_Image.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Fl_Image.cxx b/src/Fl_Image.cxx
index 0b844255c..60e56078a 100644
--- a/src/Fl_Image.cxx
+++ b/src/Fl_Image.cxx
@@ -156,13 +156,13 @@ Fl_Image *Fl_RGB_Image::copy(int W, int H) {
if (array) {
// Make a copy of the image data and return a new Fl_RGB_Image...
new_array = new uchar[w() * h() * d()];
- if (ld()) {
+ if (ld() && ld()!=w()*d()) {
const uchar *src = array;
uchar *dst = new_array;
- int dy, dh = h(), wd = w()*d(), wdld = wd+ld();
+ int dy, dh = h(), wd = w()*d(), wld = ld();
for (dy=0; dy<dh; dy++) {
memcpy(dst, src, wd);
- src += wdld;
+ src += wld;
dst += wd;
}
} else {