mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-27 15:32:59 +02:00
fb_accel_td: don't crash for no reason
This commit is contained in:
@@ -109,6 +109,7 @@ void CFbAccelTD::blit2FB(void *fbbuff, uint32_t width, uint32_t height, uint32_t
|
||||
DFBResult err;
|
||||
IDirectFBSurface *surf;
|
||||
DFBSurfaceDescription dsc;
|
||||
int pitch = width * sizeof(fb_pixel_t);
|
||||
|
||||
src.x = xp;
|
||||
src.y = yp;
|
||||
@@ -120,12 +121,13 @@ void CFbAccelTD::blit2FB(void *fbbuff, uint32_t width, uint32_t height, uint32_t
|
||||
dsc.width = width;
|
||||
dsc.height = height;
|
||||
dsc.preallocated[0].data = fbbuff;
|
||||
dsc.preallocated[0].pitch = width * sizeof(fb_pixel_t);
|
||||
dsc.preallocated[0].pitch = pitch;
|
||||
err = dfb->CreateSurface(dfb, &dsc, &surf);
|
||||
/* TODO: maybe we should not die if this fails? */
|
||||
if (err != DFB_OK) {
|
||||
fprintf(stderr, LOGTAG "blit2FB: ");
|
||||
DirectFBErrorFatal("dfb->CreateSurface(dfb, &dsc, &surf)", err);
|
||||
/* probably width or height out of range... */
|
||||
fprintf(stderr, LOGTAG "blit2FB: w:%d h:%d data:0x%p pitch:%d\n", width, height, fbbuff, pitch);
|
||||
DirectFBError("dfb->CreateSurface(dfb, &dsc, &surf)", err);
|
||||
return;
|
||||
}
|
||||
|
||||
if (transp)
|
||||
|
Reference in New Issue
Block a user