mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-26 17:00:06 +01:00
__glXDRIbindTexImage: Fail if no texture bound to pixmap's texture target.
We would most likely crash somewhere in Mesa if we tried to continue in this
case.
(cherry picked from commit 0958505961)
This commit is contained in:
parent
f84613d6fc
commit
8ffed8b913
1 changed files with 10 additions and 7 deletions
|
|
@ -374,17 +374,25 @@ __glXDRIbindTexImage(__GLXcontext *baseContext,
|
|||
{
|
||||
RegionPtr pRegion = NULL;
|
||||
PixmapPtr pixmap;
|
||||
int bpp, override = 0;
|
||||
int bpp, override = 0, texname;
|
||||
GLenum format, type;
|
||||
ScreenPtr pScreen = glxPixmap->pScreen;
|
||||
__GLXDRIscreen * const screen =
|
||||
(__GLXDRIscreen *) __glXgetActiveScreen(pScreen->myNum);
|
||||
|
||||
CALL_GetIntegerv(GET_DISPATCH(), (glxPixmap->target == GL_TEXTURE_2D ?
|
||||
GL_TEXTURE_BINDING_2D :
|
||||
GL_TEXTURE_BINDING_RECTANGLE_NV,
|
||||
&texname));
|
||||
|
||||
if (!texname)
|
||||
return __glXError(GLXBadContextState);
|
||||
|
||||
pixmap = (PixmapPtr) glxPixmap->pDraw;
|
||||
|
||||
if (screen->texOffsetStart && screen->driScreen.setTexOffset) {
|
||||
__GLXpixmap **texOffsetOverride = screen->texOffsetOverride;
|
||||
int i, firstEmpty = 16, texname;
|
||||
int i, firstEmpty = 16;
|
||||
|
||||
for (i = 0; i < 16; i++) {
|
||||
if (texOffsetOverride[i] == glxPixmap)
|
||||
|
|
@ -409,11 +417,6 @@ alreadyin:
|
|||
|
||||
glxPixmap->pDRICtx = &((__GLXDRIcontext*)baseContext)->driContext;
|
||||
|
||||
CALL_GetIntegerv(GET_DISPATCH(), (glxPixmap->target == GL_TEXTURE_2D ?
|
||||
GL_TEXTURE_BINDING_2D :
|
||||
GL_TEXTURE_BINDING_RECTANGLE_NV,
|
||||
&texname));
|
||||
|
||||
if (texname == glxPixmap->texname)
|
||||
return Success;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue