File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -269,7 +269,7 @@ final public class SGLImageDecoderGIF : SGLImageDecoder {
269
269
}
270
270
271
271
if ( avail & codemask) == 0 && avail <= 0x0FFF {
272
- codesize++
272
+ codesize += 1
273
273
codemask = ( 1 << codesize) - 1
274
274
}
275
275
oldcode = code
Original file line number Diff line number Diff line change @@ -133,7 +133,11 @@ final public class SGLImageDecoderPNG : SGLImageDecoder {
133
133
}
134
134
self . chunk_length -= 1
135
135
return self . loader. readUInt8 ( )
136
- } , filter ( img)
136
+ } , {
137
+ if self . filter ( $0) {
138
+ self . line ( img)
139
+ }
140
+ }
137
141
)
138
142
// discard IDAT checksum
139
143
if ( !crushed) {
@@ -218,7 +222,7 @@ final public class SGLImageDecoderPNG : SGLImageDecoder {
218
222
}
219
223
220
224
221
- private func filter< T : SGLImageType > ( img : T ) ( byteImut: UInt8 )
225
+ private func filter( byteImut: UInt8 ) -> Bool
222
226
{
223
227
var byte = byteImut
224
228
if linePos == 0 {
@@ -231,7 +235,7 @@ final public class SGLImageDecoderPNG : SGLImageDecoder {
231
235
for i in 0 ..< filterStride {
232
236
lineBuf [ i] = 0
233
237
}
234
- return
238
+ return false
235
239
}
236
240
switch filter {
237
241
case 0 : // none
@@ -276,8 +280,9 @@ final public class SGLImageDecoderPNG : SGLImageDecoder {
276
280
}
277
281
linePos = 0
278
282
// successful line
279
- line ( img )
283
+ return true
280
284
}
285
+ return false
281
286
}
282
287
283
288
You can’t perform that action at this time.
0 commit comments