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:
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user