Add an end of data concept

This commit is contained in:
Nigel Tao committed 2018-02-10 12:13:26 +11:00
1 parent bde5a6d39e
commit d3770b9972
9 files changed
+57 -14

No files matched your search

+5 -1
View File
@@ -69,12 +69,16 @@ pub func decoder.decode_frame?(dst writer1, src reader1)() {
//
// TODO: reset this.lzw if it's not the first ID.
this.decode_id?(dst:in.dst, src:in.src)
} else if c == 0x3B { // The spec calls 0x3B the "Trailer".
return
} else if c == 0x3B { // The spec calls 0x3B the "Trailer".
break
} else {
return error "bad GIF block"
}
}
while true {
yield suspension "end of data"
}
}
// decode_header reads either "GIF87a" or "GIF89a".