diff options
-rw-r--r-- | source/pdf/pdf-object.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/pdf/pdf-object.c b/source/pdf/pdf-object.c index b9076dc8..176b0933 100644 --- a/source/pdf/pdf-object.c +++ b/source/pdf/pdf-object.c @@ -364,7 +364,7 @@ void pdf_set_str_len(fz_context *ctx, pdf_obj *obj, int newlen) RESOLVE(obj); if (obj < PDF_OBJ__LIMIT || obj->kind != PDF_STRING) return; /* This should never happen */ - if (newlen > STRING(obj)->len) + if (newlen < 0 || (unsigned int)newlen > STRING(obj)->len) return; /* This should never happen */ STRING(obj)->len = newlen; } |