ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinha...@outlook.com> | 
Tue Mar  4 18:07:23 2025 +0100| [8940a6153ff60f9649d5bbde021df98bae68d543] | 
committer: Andreas Rheinhardt

avcodec/mjpegenc: Constify parent ctx in encode_block()

Said parent is shared between all slice contexts and encode_block()
can be run concurrently by slice threads, so the parent context
must not be (and is not) modified. So constify the pointers.

Reviewed-by: Ramiro Polla <ramiro.po...@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinha...@outlook.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8940a6153ff60f9649d5bbde021df98bae68d543
---

 libavcodec/mjpegenc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/mjpegenc.c b/libavcodec/mjpegenc.c
index 0bd362c3af..bcfc5523fb 100644
--- a/libavcodec/mjpegenc.c
+++ b/libavcodec/mjpegenc.c
@@ -480,9 +480,9 @@ static void encode_block(MpegEncContext *s, int16_t *block, 
int n)
 {
     int mant, nbits, code, i, j;
     int component, dc, run, last_index, val;
-    MJpegContext *m = s->mjpeg_ctx;
-    uint8_t *huff_size_ac;
-    uint16_t *huff_code_ac;
+    const MJpegContext *const m = s->mjpeg_ctx;
+    const uint16_t *huff_code_ac;
+    const uint8_t  *huff_size_ac;
 
     /* DC coef */
     component = (n <= 3 ? 0 : (n&1) + 1);

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to