]>
Commit | Line | Data |
---|---|---|
331e1f00 JB |
1 | --- libgd-2.1.0/src/gd_gif_in.c.orig 2013-07-04 16:17:44.855925413 +0200 |
2 | +++ libgd-2.1.0/src/gd_gif_in.c 2013-07-04 16:35:04.025881804 +0200 | |
3 | @@ -498,15 +498,16 @@ LWZReadByte_(gdIOCtx *fd, LZW_STATIC_DAT | |
4 | return sd->firstcode; | |
5 | } else if(code == sd->end_code) { | |
6 | int count; | |
7 | + int max_count = 1024; | |
8 | unsigned char buf[260]; | |
0f4482da | 9 | |
331e1f00 JB |
10 | if(*ZeroDataBlockP) { |
11 | return -2; | |
12 | } | |
0f4482da | 13 | |
331e1f00 JB |
14 | - while((count = GetDataBlock(fd, buf, ZeroDataBlockP)) > 0); |
15 | + while((count = GetDataBlock(fd, buf, ZeroDataBlockP)) > 0 && (--max_count >= 0)); | |
0f4482da | 16 | |
331e1f00 JB |
17 | - if(count != 0) { |
18 | + if((count != 0) || (max_count < 0)) { | |
19 | return -2; | |
20 | } | |
21 | } |