diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c
index 07fddd568b7c8b2fcc5cd7033600e841ff92b872..9bde714d62473a50ee1c0520199cf993a0b5a0b6 100644
--- a/libavcodec/mpeg12.c
+++ b/libavcodec/mpeg12.c
@@ -2288,7 +2288,7 @@ eos: // end of slice
 
 static int slice_decode_thread(AVCodecContext *c, void *arg){
     MpegEncContext *s= arg;
-    uint8_t *buf= s->gb.buffer;
+    const uint8_t *buf= s->gb.buffer;
     int mb_y= s->start_mb_y;
 
     s->error_count= 3*(s->end_mb_y - s->start_mb_y)*s->mb_width;