diff options
author | Stanislav Vorobiov <s.vorobiov@samsung.com> | 2014-04-28 19:36:33 +0400 |
---|---|---|
committer | Stanislav Vorobiov <s.vorobiov@samsung.com> | 2014-04-28 19:41:11 +0400 |
commit | 2abd29878f2f3b1cbd9cbb4c9cb0e64d5335be8f (patch) | |
tree | 960a4224614f6a66ade3239432db9c0b8b89035b /GLESv2 | |
parent | 4c32c4bdf060879a4b00701f082935d40776fe2b (diff) | |
download | emulator-yagl-2abd29878f2f3b1cbd9cbb4c9cb0e64d5335be8f.tar.gz emulator-yagl-2abd29878f2f3b1cbd9cbb4c9cb0e64d5335be8f.tar.bz2 emulator-yagl-2abd29878f2f3b1cbd9cbb4c9cb0e64d5335be8f.zip |
YaGL: Fix glTexImageXXX NULL pointer offset bugsubmit/tizen/20140428.162945
If we set non-0 GL_UNPACK_SKIP_XXX and call glTexImageXXX
with NULL pointer then NULL will get offset and it'll result in
guest app crash. We should offset NULL data pointer only
if unpack PBO is bound, when no unpack PBO bound we
should just calculate the size and don't offset the pointer
Change-Id: Ie921016f0245f7042393cae98f04f80300bc85a1
Signed-off-by: Stanislav Vorobiov <s.vorobiov@samsung.com>
Diffstat (limited to 'GLESv2')
-rw-r--r-- | GLESv2/yagl_gles2_calls.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/GLESv2/yagl_gles2_calls.c b/GLESv2/yagl_gles2_calls.c index 8a5f5aa..8bc7e86 100644 --- a/GLESv2/yagl_gles2_calls.c +++ b/GLESv2/yagl_gles2_calls.c @@ -2447,8 +2447,13 @@ YAGL_API void glTexImage3D(GLenum target, GLint level, GLint internalformat, GLs goto out; } - pixels += yagl_pixel_format_get_info(pf, &ctx->base.unpack, - width, height, depth, &size); + if (pixels || using_pbo) { + pixels += yagl_pixel_format_get_info(pf, &ctx->base.unpack, + width, height, depth, &size); + } else { + yagl_pixel_format_get_info(pf, &ctx->base.unpack, + width, height, depth, &size); + } if (using_pbo) { yagl_host_glTexImage3DOffset(target, |