diff --git a/libavcodec/asv1.c b/libavcodec/asv1.c
index 8db23c07efe799983bcb5ba39557d696624fa4fe..754c1aa89a55240f9c4e5dba55715afa611e775b 100644
--- a/libavcodec/asv1.c
+++ b/libavcodec/asv1.c
@@ -408,7 +408,8 @@ static int decode_frame(AVCodecContext *avctx,
     p->pict_type= AV_PICTURE_TYPE_I;
     p->key_frame= 1;
 
-    av_fast_malloc(&a->bitstream_buffer, &a->bitstream_buffer_size, buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
+    av_fast_padded_malloc(&a->bitstream_buffer, &a->bitstream_buffer_size,
+                          buf_size);
     if (!a->bitstream_buffer)
         return AVERROR(ENOMEM);