diff --git a/libavcodec/roqvideo.h b/libavcodec/roqvideo.h
index c7544278f26d56b265fd4192f5826fe23e817aa5..3345635ee86f28e804bceb87c004917efc9bf603 100644
--- a/libavcodec/roqvideo.h
+++ b/libavcodec/roqvideo.h
@@ -51,7 +51,7 @@ typedef struct RoqContext {
     roq_cell cb2x2[256];
     roq_qcell cb4x4[256];
 
-    unsigned char *buf;
+    const unsigned char *buf;
     int size;
     int width, height;
 
diff --git a/libavcodec/roqvideodec.c b/libavcodec/roqvideodec.c
index 67687cea9ee3c547dbf82bd34b3fc6e78fb262fb..a4e32c3fa22d6e8da3cfc3f72aa4cbb61f4bbc93 100644
--- a/libavcodec/roqvideodec.c
+++ b/libavcodec/roqvideodec.c
@@ -44,7 +44,7 @@ static void roqvideo_decode_frame(RoqContext *ri)
     int frame_stats[2][4] = {{0},{0}};
     roq_qcell *qcell;
     const unsigned char *buf = ri->buf;
-    unsigned char *buf_end = ri->buf + ri->size;
+    const unsigned char *buf_end = ri->buf + ri->size;
 
     while (buf < buf_end) {
         chunk_id = bytestream_get_le16(&buf);