diff --git a/libavcodec/kgv1dec.c b/libavcodec/kgv1dec.c
index edbc2b266694421d901d69810ebb9d02aa7c6a77..b81ba75325ba0f4e78fdae79455cc3650c1cefa1 100644
--- a/libavcodec/kgv1dec.c
+++ b/libavcodec/kgv1dec.c
@@ -82,8 +82,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
 
     if ((res = ff_get_buffer(avctx, frame, 0)) < 0)
         return res;
-    out  = c->frame_buffer;
-    prev = c->last_frame_buffer;
+    out  = (uint8_t*)c->frame_buffer;
+    prev = (uint8_t*)c->last_frame_buffer;
 
     for (i = 0; i < 8; i++)
         offsets[i] = -1;