g3dvl: Return BadAlloc if we can't create an XvMC surface.

This commit is contained in:
Younes Manton
2009-01-13 22:58:43 -05:00
parent c35dc4a741
commit 11f91936f2
2 changed files with 13 additions and 8 deletions
@@ -51,6 +51,12 @@ int vlCreateSurface
sfc->texture = vlGetPipeScreen(screen)->texture_create(vlGetPipeScreen(screen), &template);
if (!sfc->texture)
{
FREE(sfc);
return 1;
}
*surface = sfc;
return 0;
+7 -8
View File
@@ -73,14 +73,13 @@ Status XvMCCreateSurface(Display *display, XvMCContext *context, XvMCSurface *su
assert(display == vlGetNativeDisplay(vlGetDisplay(vlContextGetScreen(vl_ctx))));
vlCreateSurface
(
vlContextGetScreen(vl_ctx),
context->width,
context->height,
vlGetPictureFormat(vl_ctx),
&vl_sfc
);
if (vlCreateSurface(vlContextGetScreen(vl_ctx),
context->width, context->height,
vlGetPictureFormat(vl_ctx),
&vl_sfc))
{
return BadAlloc;
}
vlBindToContext(vl_sfc, vl_ctx);