summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnders Bakken <anders.bakken@nokia.com>2009-04-06 23:24:41 (GMT)
committerAnders Bakken <anders.bakken@nokia.com>2009-04-06 23:24:41 (GMT)
commit3b68e5157e103dec536d5aaff508c1751f20c62e (patch)
treef4c31f6568df0aed71f7151c88ab77cf03e8afec
parent6393b9fa8474b7b9e86319f54477cba9bec65d11 (diff)
downloadQt-3b68e5157e103dec536d5aaff508c1751f20c62e.zip
Qt-3b68e5157e103dec536d5aaff508c1751f20c62e.tar.gz
Qt-3b68e5157e103dec536d5aaff508c1751f20c62e.tar.bz2
Don't use uninitialized caps
If flags does not contain DSDESC_CAPS caps might very well be uninitialized. Make sure to properly deal with this situation. Reviewed-by: Donald <qt-info@nokia.com>
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp
index fd6f48a..39a2d48 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp
@@ -218,8 +218,12 @@ IDirectFBSurface* QDirectFBScreen::createDFBSurface(const DFBSurfaceDescription
if (d_ptr->videoonly && !(desc->flags & DSDESC_PREALLOCATED)) {
// Add the video only capability. This means the surface will be created in video ram
DFBSurfaceDescription voDesc = *desc;
- voDesc.caps = DFBSurfaceCapabilities(voDesc.caps | DSCAPS_VIDEOONLY);
- voDesc.flags = DFBSurfaceDescriptionFlags(voDesc.flags | DSDESC_CAPS);
+ if (!(voDesc.flags & DSDESC_CAPS)) {
+ voDesc.caps = DSCAPS_VIDEOONLY;
+ voDesc.flags = DFBSurfaceDescriptionFlags(voDesc.flags | DSDESC_CAPS);
+ } else {
+ voDesc.caps = DFBSurfaceCapabilities(voDesc.caps | DSCAPS_VIDEOONLY);
+ }
result = d_ptr->dfb->CreateSurface(d_ptr->dfb, &voDesc, &newSurface);
}