Have the GIF decoder check for "not enough data"

Fixes #20
This commit is contained in:
Nigel Tao committed 2019-02-23 14:29:16 +11:00
1 parent 6974c4d629
commit d7f434c6e4
9 files changed
+162 -43

No files matched your search

+5 -1
View File
@@ -763,7 +763,11 @@ pri func decoder.decode_id_part2?(dst ptr base.pixel_buffer, src base.io_reader,
this.compressed_ri = 0
this.compressed_wi = 0
// TODO: check for "not enough pixel data".
if (this.dst_y < this.frame_rect_y1) and
(this.frame_rect_x0 != this.frame_rect_x1) and
(this.frame_rect_y0 != this.frame_rect_y1) {
return base."?not enough data"
}
}
pri func decoder.copy_to_image_buffer!(pb ptr base.pixel_buffer, src slice base.u8) base.status {