diff --git a/libavformat/wavdec.c b/libavformat/wavdec.c
index d5b3b9ef2f..0dee7f329c 100644
--- a/libavformat/wavdec.c
+++ b/libavformat/wavdec.c
@@ -700,7 +700,7 @@ static int w64_read_header(AVFormatContext *s)
             avio_skip(pb, end - avio_tell(pb));
         } else {
             av_log(s, AV_LOG_DEBUG, "unknown guid: "FF_PRI_GUID"\n", FF_ARG_GUID(guid));
-            avio_skip(pb, size - 24);
+            avio_skip(pb, FFALIGN(size, INT64_C(8)) - 24);
         }
     }