Otherwise, if you have a large read fail and then try to do a small read, the small read may succeed even though it's at the wrong offset.
Cc: mesa-sta...@lists.freedesktop.org --- src/compiler/glsl/blob.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/compiler/glsl/blob.c b/src/compiler/glsl/blob.c index 3c4aed8..e837cdf 100644 --- a/src/compiler/glsl/blob.c +++ b/src/compiler/glsl/blob.c @@ -207,6 +207,9 @@ blob_reader_init(struct blob_reader *blob, uint8_t *data, size_t size) static bool ensure_can_read(struct blob_reader *blob, size_t size) { + if (blob->overrun) + return false; + if (blob->current < blob->end && blob->end - blob->current >= size) return true; -- 2.5.0.400.gff86faf _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev