diff --git a/plug-ins/common/file-tga.c b/plug-ins/common/file-tga.c index 8a74ecc51e..7c2e7e1a7b 100644 --- a/plug-ins/common/file-tga.c +++ b/plug-ins/common/file-tga.c @@ -1353,7 +1353,10 @@ save_image (GFile *file, fputc (0, fp); } - pixels = g_new (guchar, width * out_bpp); + if (dtype == GIMP_INDEXEDA_IMAGE) + pixels = g_new (guchar, width * 2); + else + pixels = g_new (guchar, width * out_bpp); data = g_new (guchar, width * out_bpp); for (row = 0; row < height; ++row)