about summary refs log tree commit diff
path: root/urt/rle_getrow.c
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2019-09-28 19:34:22 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2019-09-28 19:34:22 +0000
commit860faaae6a58e83623b9620dc0e0f36f3126b251 (patch)
treee09259abd808ac7e9a4c2494e1ccefa0d08ef991 /urt/rle_getrow.c
parent2b499210eb2a64c95e6891a8d361b38a8502e063 (diff)
downloadnetpbm-mirror-860faaae6a58e83623b9620dc0e0f36f3126b251.tar.gz
netpbm-mirror-860faaae6a58e83623b9620dc0e0f36f3126b251.tar.xz
netpbm-mirror-860faaae6a58e83623b9620dc0e0f36f3126b251.zip
Promote Development to Advanced
git-svn-id: http://svn.code.sf.net/p/netpbm/code/advanced@3691 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'urt/rle_getrow.c')
-rw-r--r--urt/rle_getrow.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/urt/rle_getrow.c b/urt/rle_getrow.c
index 679811cc..ae220f5b 100644
--- a/urt/rle_getrow.c
+++ b/urt/rle_getrow.c
@@ -102,9 +102,13 @@ rle_get_setup(rle_hdr * const the_hdr) {
         rle_pixel * bg_color;
 
         MALLOCARRAY(the_hdr->bg_color, setup.h_ncolors);
+        if (!the_hdr->bg_color)
+            pm_error("Failed to allocation array for %u background colors",
+                     setup.h_ncolors);
         MALLOCARRAY(bg_color, 1 + (setup.h_ncolors / 2) * 2);
-        RLE_CHECK_ALLOC(the_hdr->cmd, the_hdr->bg_color && bg_color,
-                        "background color" );
+        if (!bg_color)
+            pm_error("Failed to allocation array for %u background colors",
+                     1+(setup.h_ncolors / 2) * 2);
         fread((char *)bg_color, 1, 1 + (setup.h_ncolors / 2) * 2, infile);
         for (i = 0; i < setup.h_ncolors; ++i)
             the_hdr->bg_color[i] = bg_color[i];