ecore-drm: Return the index of the crtc from output_crtc_find
authorChris Michael <devilhorns@comcast.net>
Wed, 11 Mar 2015 21:09:48 +0000 (17:09 -0400)
committerMike Blumenkrantz <zmike@osg.samsung.com>
Wed, 11 Mar 2015 21:09:49 +0000 (17:09 -0400)
Summary:
Fix issue of invalid memory read from
ecore_drm_output_create. We call ecore_drm_output_crtc_find to get the
Index of the crtc to use, however prior to this commit the index was
not being returned (the actual crtc was)

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
Reviewers: zmike

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2140

src/lib/ecore_drm/ecore_drm_output.c

index a86c4e6..16e1db3 100644 (file)
@@ -204,7 +204,7 @@ _ecore_drm_output_crtc_find(Ecore_Drm_Device *dev, drmModeRes *res, drmModeConne
              if ((p & (1 << i)) &&
                  (!(dev->crtc_allocator & (1 << res->crtcs[i]))))
                {
-                  return res->crtcs[i];
+                  return i;
                }
           }
      }