Support images with variable dimensions

For example, AES2501 returns images that vary in height.
This commit is contained in:
Daniel Drake
2007-11-08 13:56:21 +00:00
parent e1a25eeb67
commit b9238e8b8a
2 changed files with 36 additions and 15 deletions

View File

@@ -176,6 +176,11 @@ int main(void)
img_width = fp_dev_get_img_width(dev);
img_height = fp_dev_get_img_height(dev);
if (img_width <= 0 || img_height <= 0) {
fprintf(stderr, "this device returns images with variable dimensions,"
" this example does not support that.\n");
goto out;
}
framebuffer = malloc(img_width * img_height * 2);
if (!framebuffer)
goto out;