summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/compiler/glsl/blob.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compiler/glsl/blob.c b/src/compiler/glsl/blob.c
index 769ebf1a023..db362520650 100644
--- a/src/compiler/glsl/blob.c
+++ b/src/compiler/glsl/blob.c
@@ -107,7 +107,7 @@ blob_overwrite_bytes(struct blob *blob,
size_t to_write)
{
/* Detect an attempt to overwrite data out of bounds. */
- if (offset < 0 || blob->size - offset < to_write)
+ if (blob->size < offset + to_write)
return false;
memcpy(blob->data + offset, bytes, to_write);