diff --git a/FL/Fl_Image.H b/FL/Fl_Image.H
index 37774ef..821feaa 100644
--- a/FL/Fl_Image.H
+++ b/FL/Fl_Image.H
@@ -3,7 +3,7 @@
 //
 // Image header file for the Fast Light Tool Kit (FLTK).
 //
-// Copyright 1998-2014 by Bill Spitzak and others.
+// Copyright 1998-2016 by Bill Spitzak and others.
 //
 // This library is free software. Distribution and use rights are outlined in
 // the file "COPYING" which should have been included with this file.  If this
@@ -84,6 +84,13 @@ protected:
   void d(int D) {d_ = D;}
   /**
    Sets the current line data size in bytes.
+   Color images may contain extra data that is included after every
+   line of color image data and is normally not present.
+
+   If \p LD is zero, then line data size is assumed to be w() * d() bytes.
+
+   If \p LD is non-zero, then it must be positive and larger than w() * d()
+   to account for the additional data per line.
    */
   void ld(int LD) {ld_ = LD;}
   /** 
@@ -113,8 +120,7 @@ public:
   int d() const {return d_;}
   /**
    Returns the current line data size in bytes.
-   Line data is extra data that is included
-   after each line of color image data and is normally not present.
+   \see ld(int)
    */
   int ld() const {return ld_;}
   /**
diff --git a/src/Fl_File_Icon2.cxx b/src/Fl_File_Icon2.cxx
index bb6964c..1f13e73 100644
--- a/src/Fl_File_Icon2.cxx
+++ b/src/Fl_File_Icon2.cxx
@@ -353,9 +353,10 @@ int Fl_File_Icon::load_image(const char *ifile)	// I - File to read from
 		temp;		// Temporary color
     const uchar *row;		// Pointer into image
 
+    const int extra_data = img->ld() ? (img->ld()-img->w()*img->d()) : 0;
 
     // Loop through grayscale or RGB image...
-    for (y = 0, row = (const uchar *)(*(img->data())); y < img->h(); y ++, row += img->ld())
+    for (y = 0, row = (const uchar *)(*(img->data())); y < img->h(); y ++, row += extra_data)
     {
       for (x = 0, startx = 0, c = (Fl_Color)-1;
            x < img->w();
@@ -427,7 +428,6 @@ int Fl_File_Icon::load_image(const char *ifile)	// I - File to read from
     int		x, y;			// X & Y in image
     int		startx;			// Starting X coord
 
-
     // Get the pixmap data...
     ptr = img->data();
     sscanf(*ptr, "%*d%*d%d%d", &ncolors, &chars_per_color);
diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx
index c3b2d4e..2de0995 100644
--- a/src/Fl_win32.cxx
+++ b/src/Fl_win32.cxx
@@ -2225,8 +2225,10 @@ static HICON image_to_icon(const Fl_RGB_Image *image, bool is_icon,
     return NULL;
 
   const uchar *i = (const uchar*)*image->data();
-  for (int y = 0;y < image->h();y++) {
-    for (int x = 0;x < image->w();x++) {
+  const int extra_data = image->ld() ? (image->ld()-image->w()*image->d()) : 0;
+
+  for (int y = 0; y < image->h(); y++) {
+    for (int x = 0; x < image->w(); x++) {
       switch (image->d()) {
       case 1:
         *bits = (0xff<<24) | (i[0]<<16) | (i[0]<<8) | i[0];
@@ -2244,7 +2246,7 @@ static HICON image_to_icon(const Fl_RGB_Image *image, bool is_icon,
       i += image->d();
       bits++;
     }
-    i += image->ld();
+    i += extra_data;
   }
 
   // A mask bitmap is still needed even though it isn't used
@@ -2267,9 +2269,6 @@ static HICON image_to_icon(const Fl_RGB_Image *image, bool is_icon,
   DeleteObject(bitmap);
   DeleteObject(mask);
 
-  if (icon == NULL)
-    return NULL;
-
   return icon;
 }
 
diff --git a/src/Fl_x.cxx b/src/Fl_x.cxx
index e0be1a0..df6ca4d 100644
--- a/src/Fl_x.cxx
+++ b/src/Fl_x.cxx
@@ -2727,9 +2727,11 @@ static void icons_to_property(const Fl_RGB_Image *icons[], int count,
     data[1] = image->h();
     data += 2;
 
+    const int extra_data = image->ld() ? (image->ld()-image->w()*image->d()) : 0;
+
     const uchar *in = (const uchar*)*image->data();
-    for (int y = 0;y < image->h();y++) {
-      for (int x = 0;x < image->w();x++) {
+    for (int y = 0; y < image->h(); y++) {
+      for (int x = 0; x < image->w(); x++) {
         switch (image->d()) {
         case 1:
           *data = ( 0xff<<24) | (in[0]<<16) | (in[0]<<8) | in[0];
@@ -2747,7 +2749,7 @@ static void icons_to_property(const Fl_RGB_Image *icons[], int count,
         in += image->d();
         data++;
       }
-      in += image->ld();
+      in += extra_data;
     }
   }
 }
@@ -2863,6 +2865,7 @@ int Fl_X::set_cursor(const Fl_RGB_Image *image, int hotx, int hoty) {
   if (!cursor)
     return 0;
 
+  const int extra_data = image->ld() ? (image->ld()-image->w()*image->d()) : 0;
   const uchar *i = (const uchar*)*image->data();
   XcursorPixel *o = cursor->pixels;
   for (int y = 0;y < image->h();y++) {
@@ -2884,7 +2887,7 @@ int Fl_X::set_cursor(const Fl_RGB_Image *image, int hotx, int hoty) {
       i += image->d();
       o++;
     }
-    i += image->ld();
+    i += extra_data;
   }
 
   cursor->xhot = hotx;
