ecore drm2 - handle possible NULL fb when doing a flip
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>
Wed, 10 Apr 2019 15:09:04 +0000 (16:09 +0100)
committerShinwoo Kim <cinoo.kim@samsung.com>
Wed, 17 Apr 2019 01:03:27 +0000 (10:03 +0900)
src/lib/ecore_drm2/ecore_drm2_fb.c

index 017f98169374fc20e5eb710ef3b66f0cf3500d77..e8f6c167621414dc12bcbed6c3d483d05d0d779f 100644 (file)
@@ -510,6 +510,16 @@ _fb_flip(Ecore_Drm2_Output *output)
    int ret = 0;
 
    fb = output->prep.fb;
+   if (!fb)
+     {
+        fb =  output->pending.fb;
+        ERR("Trying to flip NULL fb - fallback to pending fb");
+     }
+   if (!fb)
+     {
+        ERR("Pending fb is also NULL, give up flipping");
+        return ret;
+     }
 
    if ((!output->current.fb) ||
        (output->current.fb->strides[0] != fb->strides[0]))