diff --git a/externals/pdogg/oggamp~.c b/externals/pdogg/oggamp~.c
index 9ee27b8f3d9861b749f090d39c85f71380140fec..2dfe189cb22bacfac4cdde2777bf9b73179e2bd5 100644
--- a/externals/pdogg/oggamp~.c
+++ b/externals/pdogg/oggamp~.c
@@ -1004,7 +1004,7 @@ static void oggamp_tick(t_oggamp *x)
 static void *oggamp_new(t_floatarg fdographics, t_floatarg fnchannels, t_floatarg fbufsize)
 {
     t_oggamp *x;
-    int nchannels = fnchannels, bufsize = fbufsize * 1024, i;
+    int nchannels = fnchannels, bufsize = ((double)fbufsize) * 1024, i;
     float *buf;
     
     if (nchannels < 1)
diff --git a/externals/pdogg/oggcast~.c b/externals/pdogg/oggcast~.c
index e4b5a2eb076b034ea50e71b9624472f9125befa9..b80fa026769f1a52229f9251e57696cd549324ea 100644
--- a/externals/pdogg/oggcast~.c
+++ b/externals/pdogg/oggcast~.c
@@ -998,7 +998,11 @@ static void oggcast_tick_pages(t_oggcast *x)
 static void *oggcast_new(t_floatarg fnchannels, t_floatarg fbufsize)
 {
     t_oggcast *x;
-    int nchannels = fnchannels, bufsize = fbufsize * 1024, i;
+    /* The cast to double below is a workaround for an unrecognized instruction
+       when running the arm CI runner under valgrind. Fortunately there are
+       only a handful of these in the entire codebase. Once this gets fixed
+       upstream in Valgrind these casts can be removed. */
+    int nchannels = fnchannels, bufsize = ((double)fbufsize) * 1024, i;
     float *buf;
     
     if (nchannels < 1)