raster pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=9001073b0baefedebb4a18dade14aea52fc34ab8

commit 9001073b0baefedebb4a18dade14aea52fc34ab8
Author: Carsten Haitzler (Rasterman) <ras...@rasterman.com>
Date:   Sat Jan 9 04:11:38 2021 +0000

    music control - handle out of bounds len/pos of playback
---
 src/modules/music-control/e_mod_main.c | 1 +
 src/modules/music-control/ui.c         | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/src/modules/music-control/e_mod_main.c 
b/src/modules/music-control/e_mod_main.c
index 127ff13f0..33a20d8b1 100644
--- a/src/modules/music-control/e_mod_main.c
+++ b/src/modules/music-control/e_mod_main.c
@@ -405,6 +405,7 @@ prop_changed(void *data, Eldbus_Proxy *proxy EINA_UNUSED, 
void *event_info)
         long long llval = 0;
 
         eina_value_get(value, &llval);
+        if (llval < 0) llval = 0;
         ctxt->position = (double)llval / 1000000.0;
         music_control_pos_update(ctxt);
      }
diff --git a/src/modules/music-control/ui.c b/src/modules/music-control/ui.c
index ea3b97f92..2a933ad4e 100644
--- a/src/modules/music-control/ui.c
+++ b/src/modules/music-control/ui.c
@@ -12,6 +12,8 @@ _pos_update(E_Music_Control_Instance *inst)
    msg->count = 2;
    msg->val[0] = inst->ctxt->position;
    msg->val[1] = inst->ctxt->meta_length;
+   if (msg->val[0] < 0.0) msg->val[0] = 0.0;
+   if (msg->val[0] > msg->val[1]) msg->val[0] = msg->val[1];
    edje_object_message_send(inst->content_popup, EDJE_MESSAGE_FLOAT_SET, 1, 
msg);
 }
 

-- 


Reply via email to