diff --git a/libavcodec/hevc_mp4toannexb_bsf.c b/libavcodec/hevc_mp4toannexb_bsf.c
index 54d6d79b8b0c5175541e64f5f6802c68b133fed3..d6feb998f8f2a1d188b3cf3dcc73343a6fcc4361 100644
--- a/libavcodec/hevc_mp4toannexb_bsf.c
+++ b/libavcodec/hevc_mp4toannexb_bsf.c
@@ -134,7 +134,7 @@ static int hevc_mp4toannexb_filter(AVBitStreamFilterContext *bsfc,
                        "The input looks like it is Annex B already\n");
                 ctx->logged_nonmp4_warning = 1;
             }
-            *poutbuf      = buf;
+            *poutbuf      = (uint8_t *)buf;
             *poutbuf_size = buf_size;
             return 0;
         }