mesa/st: check egl image and texture target match before binding

Signed-off-by: Simon Zeni <simon@bl4ckb0ne.ca>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18673>
This commit is contained in:
Simon Zeni
2022-09-21 13:47:45 -04:00
committed by Marge Bot
parent 6a3f5c6512
commit 029522f67d
2 changed files with 7 additions and 1 deletions
+6
View File
@@ -32,6 +32,7 @@
#include "util/u_inlines.h"
#include "util/format/u_format.h"
#include "st_cb_eglimage.h"
#include "st_cb_texture.h"
#include "st_context.h"
#include "st_texture.h"
#include "st_format.h"
@@ -272,6 +273,11 @@ st_bind_egl_image(struct gl_context *ctx,
GLenum internalFormat;
mesa_format texFormat;
if (stimg->texture->target != gl_target_to_pipe(texObj->Target)) {
_mesa_error(ctx, GL_INVALID_OPERATION, __func__);
return;
}
if (stimg->internalformat) {
internalFormat = stimg->internalformat;
} else {
+1 -1
View File
@@ -43,7 +43,7 @@ struct gl_pixelstore_attrib;
struct gl_memory_object;
struct gl_sampler_object;
extern enum pipe_texture_target
enum pipe_texture_target
gl_target_to_pipe(GLenum target);
unsigned