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.
Unified · Split
| @@ -480,9 +480,9 @@ static void encode_block(MpegEncContext *s, int16_t *block, int n) · 479 unmodified lines | ||
| 480 | 480 | { |
| 481 | 481 | int mant, nbits, code, i, j; |
| 482 | 482 | int component, dc, run, last_index, val; |
| 483 | − MJpegContext *m = s->mjpeg_ctx; | |
| 484 | − uint8_t *huff_size_ac; | |
| 485 | − uint16_t *huff_code_ac; | |
| 483 | + const MJpegContext *const m = s->mjpeg_ctx; | |
| 484 | + const uint16_t *huff_code_ac; | |
| 485 | + const uint8_t *huff_size_ac; | |
| 486 | 486 | |
| 487 | 487 | /* DC coef */ |
| 488 | 488 | component = (n <= 3 ? 0 : (n&1) + 1); |