static void *alloc_with_stride_fb(void *data, int size, int *stride, int *bpp)
{
+ void *canvas;
struct info *handle = data;
int _stride;
int _bpp;
+ canvas = alloc_fb(data, size);
+ if (!canvas) {
+ ErrPrint("Unable to allocate canvas buffer\n");
+ }
+
_bpp = script_buffer_pixels(handle->buffer_handle);
if (_bpp < 0) {
ErrPrint("Failed to get pixel size, fallback to 4\n");
*stride = _stride;
*bpp = _bpp << 3;
- return alloc_fb(data, size);
+ return canvas;
}
static void free_fb(void *data, void *ptr)