summaryrefslogtreecommitdiff
path: root/tizen
diff options
context:
space:
mode:
authorJinhyung Jo <jinhyung.jo@samsung.com>2016-12-12 20:56:04 +0900
committerSeokYeon Hwang <syeon.hwang@samsung.com>2016-12-14 20:05:39 +0900
commitfe7a4ce00847da9a6371761fc8170974765c6900 (patch)
tree9be65be4948eb8e1abd53a44b184cc9eb725d632 /tizen
parentb3416ef2624afb112d1ea88837e38180b1f35528 (diff)
downloadqemu-fe7a4ce00847da9a6371761fc8170974765c6900.tar.gz
qemu-fe7a4ce00847da9a6371761fc8170974765c6900.tar.bz2
qemu-fe7a4ce00847da9a6371761fc8170974765c6900.zip
display: fix null pointer dereference with tablet
Check whether the touchscreen device is accessible. Change-Id: I85956f7b13ac534c738797843bc411d128eebc08 Signed-off-by: Jinhyung Jo <jinhyung.jo@samsung.com>
Diffstat (limited to 'tizen')
-rw-r--r--tizen/src/ui/displayglwidget.cpp30
1 files changed, 17 insertions, 13 deletions
diff --git a/tizen/src/ui/displayglwidget.cpp b/tizen/src/ui/displayglwidget.cpp
index 14aa91b935..e49e51608b 100644
--- a/tizen/src/ui/displayglwidget.cpp
+++ b/tizen/src/ui/displayglwidget.cpp
@@ -402,22 +402,26 @@ void DisplayGLWidget::initializeGL()
mTexCoords[10] = 0;
mTexCoords[11] = 1;
- GLuint curTexture = 0;
- mFuncs->glGetIntegerv(GL_TEXTURE_BINDING_2D, (GLint *)&curTexture);
- const QImage img = getTouchScreenHelper()->getMtTracker()->getPointImage();
- mFuncs->glGenTextures(1, &mtTexture);
- mFuncs->glBindTexture(GL_TEXTURE_2D, mtTexture);
- mFuncs->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- mFuncs->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- mFuncs->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- mFuncs->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
- mFuncs->glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, 32, 32, 0, GL_BGRA,
- GL_UNSIGNED_INT_8_8_8_8_REV,
- (const void *)img.constBits());
- mFuncs->glBindTexture(GL_TEXTURE_2D, curTexture);
+ if (isTsEnabled) {
+ GLuint curTexture = 0;
+ mFuncs->glGetIntegerv(GL_TEXTURE_BINDING_2D, (GLint *)&curTexture);
+ const QImage img = getTouchScreenHelper()->getMtTracker()->getPointImage();
+ mFuncs->glGenTextures(1, &mtTexture);
+ mFuncs->glBindTexture(GL_TEXTURE_2D, mtTexture);
+ mFuncs->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+ mFuncs->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+ mFuncs->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+ mFuncs->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+ mFuncs->glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, 32, 32, 0, GL_BGRA,
+ GL_UNSIGNED_INT_8_8_8_8_REV,
+ (const void *)img.constBits());
+ mFuncs->glBindTexture(GL_TEXTURE_2D, curTexture);
+ }
if (!maskQImage.isNull()) {
+ GLuint curTexture = 0;
+ mFuncs->glGetIntegerv(GL_TEXTURE_BINDING_2D, (GLint *)&curTexture);
mFuncs->glGenTextures(1, &maskTexture);
mFuncs->glBindTexture(GL_TEXTURE_2D, maskTexture);
mFuncs->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);