--- gimp-2.2.1-orig/plug-ins/common/dicom.c	2004-10-28 08:12:51.000000000 -0400
+++ gimp-2.2.1/plug-ins/common/dicom.c	2005-01-07 12:52:09.114618003 -0500
@@ -383,6 +383,8 @@ load_image (const gchar *filename)
 	  element_length = g_ntohs (GUINT16_SWAP_LE_BE (el16));
 	}
 
+      if(element_length == -1) continue;
+
       /* Read contents. Allocate a bit more to make room for casts to int
        below. */
       value = g_new0 (guint8, element_length + 4);
