summaryrefslogtreecommitdiff
blob: c7921dd2e69959af57de1e4d184bdaa08b39363c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
diff -r 50395430a371 -r 83b4d2b4b873 coders/wpg.c
--- a/coders/wpg.c	Sat May 30 10:18:16 2020 -0500
+++ b/coders/wpg.c	Sat May 30 17:33:51 2020 -0500
@@ -403,7 +403,7 @@
   x++; \
   if((long) x>=ldblk) \
   { \
-    if(InsertRow(BImgBuff,y,image,bpp)==MagickFail) RetVal=-6; \
+    if(InsertRow(BImgBuff,y,image,bpp)==MagickFail) { RetVal=-6; goto unpack_wpg_raser_error; } \
     x=0; \
     y++; \
     if(y>=image->rows) break; \
@@ -537,6 +537,7 @@
         }
       }
     }
+unpack_wpg_raser_error:;
   MagickFreeMemory(BImgBuff);
   return(RetVal);
 }
@@ -552,7 +553,7 @@
   x++; \
   if((long) x >= ldblk) \
   { \
-    if(InsertRow(BImgBuff,(long) y,image,bpp)==MagickFail) RetVal=-6; \
+    if(InsertRow(BImgBuff,(long) y,image,bpp)==MagickFail) { RetVal=-6; goto unpack_wpg2_error; } \
     x=0; \
     y++; \
     XorMe = 0; \
@@ -729,6 +730,7 @@
             }
         }
     }
+unpack_wpg2_error:;
   FreeUnpackWPG2RasterAllocs(BImgBuff,UpImgBuff);
   return(RetVal);
 }