blob: 20ea8db57abd439f835aab172ea17eaca4e6f0c0 (
plain) (
blame)
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
39
40
41
42
43
44
45
|
$FreeBSD$
--- source/oldlzw.cpp 2001/02/17 15:08:39 1.1
+++ source/oldlzw.cpp 2001/02/17 15:08:54
@@ -342,7 +339,7 @@
DecodeBuffer = (unsigned char *) realloc ( DecodeBuffer, DecodeBufferSize + 1000 );
if ( ! DecodeBuffer )
- throw toutofmem ( DecodeBufferSize + 1000 );
+ goto except1;
else
DecodeBufferSize += 1000;
}
@@ -350,6 +347,9 @@
}
DecodeBuffer[ count++ ] = code;
return ( count );
+
+except1:
+ throw toutofmem ( DecodeBufferSize + 1000 );
}
@@ -464,7 +464,7 @@
count = LZWLoadBuffer ( 0, incode );
if ( count == 0 )
- throw ASCexception();
+ goto except1;
inchar = DecodeBuffer[ count - 1 ];
while ( count )
@@ -492,7 +492,10 @@
return pos;
}
- // return 0;
+ return 0;
+
+except1:
+ throw ASCexception();
}
|