summaryrefslogtreecommitdiff
path: root/src/lib/ecore_drm2/ecore_drm2_fb.c
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2017-05-14 13:13:34 -0500
committerDerek Foreman <derekf@osg.samsung.com>2017-05-14 13:13:34 -0500
commit51f5f43d430d1bfbd4108e50c60877c35678853e (patch)
tree2bc488822abeb3d0617833e5efa958ad24652659 /src/lib/ecore_drm2/ecore_drm2_fb.c
parent1c60ac3bc9dfcfed58f15ac1c8c8f9564149b067 (diff)
ecore_drm2: Fix use after free
In trying to clean up some code and fix a hypothetical buffer leak, I added a use after free error that can break rendering on the drm and gl_drm evas engines. Coverity did the heavy lifting for me on this one. Fix Coverity CID 1375047 Fix T5484
Diffstat (limited to '')
-rw-r--r--src/lib/ecore_drm2/ecore_drm2_fb.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/ecore_drm2/ecore_drm2_fb.c b/src/lib/ecore_drm2/ecore_drm2_fb.c
index 8ef2d82bd9..114280b62d 100644
--- a/src/lib/ecore_drm2/ecore_drm2_fb.c
+++ b/src/lib/ecore_drm2/ecore_drm2_fb.c
@@ -553,7 +553,8 @@ ecore_drm2_fb_flip(Ecore_Drm2_Fb *fb, Ecore_Drm2_Output *output)
553 /* So we can generate a tick by flipping to the current fb */ 553 /* So we can generate a tick by flipping to the current fb */
554 if (!fb) fb = output->current.fb; 554 if (!fb) fb = output->current.fb;
555 555
556 if (output->next.fb) _release_buffer(output, &output->next); 556 if (output->next.fb && fb != output->next.fb)
557 _release_buffer(output, &output->next);
557 558
558 /* If we don't have an fb to set by now, BAIL! */ 559 /* If we don't have an fb to set by now, BAIL! */
559 if (!fb) return -1; 560 if (!fb) return -1;