color: icc creator offset + length error

One more error case found during implementation.

This might be a client error, but it might also be that something else
truncated the file just when the client was sending it. I have opted for
a protocol error, but should it be a graceful failure instead?

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This commit is contained in:
Pekka Paalanen 2023-12-13 14:15:20 +02:00
parent 80466d5dc9
commit 42ed80e0d5

View file

@ -636,6 +636,7 @@
<entry name="already_set" value="2" summary="property already set"/>
<entry name="bad_fd" value="3" summary="fd not seekable and readable"/>
<entry name="bad_size" value="4" summary="no or too much data"/>
<entry name="out_of_file" value="5" summary="offset + length exceeds file size"/>
</enum>
<request name="create">
@ -684,6 +685,8 @@
The maximum size of the ICC profile is 4 MB. If length is greater
than that or zero, the protocol error bad_size is raised.
If offset + length exceeds the file size, the protocol error
out_of_file is raised.
A compositor may read the file at any time starting from this request
and only until whichever happens first: