Lines 87-99
Link Here
|
87 |
/* Scan the content of the GIF file and load the image(s) in: */ |
87 |
/* Scan the content of the GIF file and load the image(s) in: */ |
88 |
do { |
88 |
do { |
89 |
if (DGifGetRecordType(GifFile, &RecordType) == GIF_ERROR) { |
89 |
if (DGifGetRecordType(GifFile, &RecordType) == GIF_ERROR) { |
90 |
PrintGifError(); |
90 |
GifErrorString(); |
91 |
exit(-1); |
91 |
exit(-1); |
92 |
} |
92 |
} |
93 |
switch (RecordType) { |
93 |
switch (RecordType) { |
94 |
case IMAGE_DESC_RECORD_TYPE: |
94 |
case IMAGE_DESC_RECORD_TYPE: |
95 |
if (DGifGetImageDesc(GifFile) == GIF_ERROR) { |
95 |
if (DGifGetImageDesc(GifFile) == GIF_ERROR) { |
96 |
PrintGifError(); |
96 |
GifErrorString(); |
97 |
exit(-1); |
97 |
exit(-1); |
98 |
} |
98 |
} |
99 |
Row = GifFile->Image.Top; /* Image Position relative to Screen. */ |
99 |
Row = GifFile->Image.Top; /* Image Position relative to Screen. */ |
Lines 113-119
Link Here
|
113 |
j += InterlacedJumps[i]) { |
113 |
j += InterlacedJumps[i]) { |
114 |
if (DGifGetLine(GifFile, &ScreenBuffer[j][Col], |
114 |
if (DGifGetLine(GifFile, &ScreenBuffer[j][Col], |
115 |
Width) == GIF_ERROR) { |
115 |
Width) == GIF_ERROR) { |
116 |
PrintGifError(); |
116 |
GifErrorString(); |
117 |
exit(-1); |
117 |
exit(-1); |
118 |
} |
118 |
} |
119 |
} |
119 |
} |
Lines 122-128
Link Here
|
122 |
for (i = 0; i < Height; i++) { |
122 |
for (i = 0; i < Height; i++) { |
123 |
if (DGifGetLine(GifFile, &ScreenBuffer[Row++][Col], |
123 |
if (DGifGetLine(GifFile, &ScreenBuffer[Row++][Col], |
124 |
Width) == GIF_ERROR) { |
124 |
Width) == GIF_ERROR) { |
125 |
PrintGifError(); |
125 |
GifErrorString(); |
126 |
exit(-1); |
126 |
exit(-1); |
127 |
} |
127 |
} |
128 |
} |
128 |
} |
Lines 131-137
Link Here
|
131 |
case EXTENSION_RECORD_TYPE: |
131 |
case EXTENSION_RECORD_TYPE: |
132 |
/* Skip any extension blocks in file: */ |
132 |
/* Skip any extension blocks in file: */ |
133 |
if (DGifGetExtension(GifFile, &ExtCode, &Extension) == GIF_ERROR) { |
133 |
if (DGifGetExtension(GifFile, &ExtCode, &Extension) == GIF_ERROR) { |
134 |
PrintGifError(); |
134 |
GifErrorString(); |
135 |
exit(-1); |
135 |
exit(-1); |
136 |
} |
136 |
} |
137 |
/* very adhoc transparency support */ |
137 |
/* very adhoc transparency support */ |
Lines 141-147
Link Here
|
141 |
} |
141 |
} |
142 |
while (Extension != NULL) { |
142 |
while (Extension != NULL) { |
143 |
if (DGifGetExtensionNext(GifFile, &Extension) == GIF_ERROR) { |
143 |
if (DGifGetExtensionNext(GifFile, &Extension) == GIF_ERROR) { |
144 |
PrintGifError(); |
144 |
GifErrorString(); |
145 |
exit(-1); |
145 |
exit(-1); |
146 |
} |
146 |
} |
147 |
} |
147 |
} |
Lines 180-186
Link Here
|
180 |
} |
180 |
} |
181 |
|
181 |
|
182 |
if (DGifCloseFile(GifFile) == GIF_ERROR) { |
182 |
if (DGifCloseFile(GifFile) == GIF_ERROR) { |
183 |
PrintGifError(); |
183 |
GifErrorString(); |
184 |
exit(-1); |
184 |
exit(-1); |
185 |
} |
185 |
} |
186 |
|
186 |
|