gems: prevent invalid Nitpicker_buffer objects

This patch ensures that we never request a zero-sized virtual
framebuffer from nitpicker even when instantiating the object with zero
width or height. It therebu removes the burden of handling the resulting
invalid framebuffer dataspace from the user of the Nitpicker_buffer
utility.
This commit is contained in:
Norman Feske 2015-12-04 12:27:23 +01:00
parent f3cce99933
commit 101b868cd4
1 changed files with 2 additions and 1 deletions

View File

@ -86,7 +86,8 @@ struct Nitpicker_buffer
Genode::Ram_session &ram)
:
ram(ram), nitpicker(nitpicker),
mode(size.w(), size.h(), nitpicker.mode().format())
mode(Genode::max(1UL, size.w()), Genode::max(1UL, size.h()),
nitpicker.mode().format())
{ }
/**