framebuffer: handle an edge case

This commit is contained in:
Matheus
2022-09-24 15:14:20 -03:00
parent 313abaeb9a
commit 619b95c7f1
+4
View File
@@ -18,6 +18,10 @@ static int devchecks(int fb, size_t* count, size_t offset){
size_t end = fbs[fb]->pitch * fbs[fb]->height;
if(offset >= end){
*count = 0;
}
if(*count + offset > end)
*count = end - offset;