summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--alsa-binding/Alsa-AddCtl.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/alsa-binding/Alsa-AddCtl.c b/alsa-binding/Alsa-AddCtl.c
index 3f969c1..108a590 100644
--- a/alsa-binding/Alsa-AddCtl.c
+++ b/alsa-binding/Alsa-AddCtl.c
@@ -74,12 +74,12 @@ static const unsigned int *allocate_int_dbscale_tlv(int min, int step, int mute)
static const unsigned int *allocate_int_linear_tlv(int max, int min) {
// SNDRV_CTL_TLVD_DECLARE_DB_LINEAR (range, min, max);
- size_t tlvSize = sizeof (4 * sizeof (unsigned int));
- unsigned int *tlv = malloc(tlvSize);
+ size_t tlvSize = 4 * sizeof (unsigned int);
+ unsigned int *tlv = malloc(4 * sizeof (unsigned int));
tlv[0] = SNDRV_CTL_TLVT_DB_LINEAR;
- tlv[1] = (int) tlvSize;
- tlv[2] = -min * 100;
- tlv[3] = max * 100;
+ tlv[1] = (unsigned int)(2 * sizeof (unsigned int));
+ tlv[2] = (unsigned int)(-min * 100);
+ tlv[3] = (unsigned int)(max * 100);
return tlv;
}