Reset best allocation to NULL

Without this, if no allocation has been found, garbage will be read from
alloc.best.
This commit is contained in:
Simon Ser 2019-09-08 17:39:55 +03:00
parent b3eb0e323c
commit 66bedbc854
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48

View file

@ -325,6 +325,7 @@ bool hwc_display_apply(struct hwc_display *display, drmModeAtomicReq *req)
* before any other plane. */
alloc.best_score = 0;
memset(alloc.best, 0, alloc.planes_len * sizeof(*alloc.best));
if (!output_choose_layers(output, &alloc, display->planes.next,
0, 0)) {
return false;