From ef5442237999808ec2893ff49055d3a89f2a62ce Mon Sep 17 00:00:00 2001 From: Themaister Date: Wed, 12 Feb 2014 15:53:04 +0100 Subject: [PATCH] Avoid temporary garbage data in alpha mod. --- gfx/video_thread_wrapper.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gfx/video_thread_wrapper.c b/gfx/video_thread_wrapper.c index 7e32bba63a..7e389ab9b0 100644 --- a/gfx/video_thread_wrapper.c +++ b/gfx/video_thread_wrapper.c @@ -173,6 +173,7 @@ static void thread_reply(thread_video_t *thr, enum thread_cmd cmd) static void thread_loop(void *data) { thread_video_t *thr = (thread_video_t*)data; + unsigned i; for (;;) { @@ -250,6 +251,8 @@ static void thread_loop(void *data) thr->cmd_data.image.num); thr->alpha_mods = thr->cmd_data.image.num; thr->alpha_mod = (float*)realloc(thr->alpha_mod, thr->alpha_mods * sizeof(float)); + for (i = 0; i < thr->alpha_mods; i++) // Avoid temporary garbage data. + thr->alpha_mod[i] = 1.0f; thread_reply(thr, CMD_OVERLAY_LOAD); break;