diff mbox series

[FFmpeg-devel,11/39] avcodec/dxv: Constify slice threads' ptr to main context

Message ID DB6PR0101MB2214E24D82E92BC9EDE6B5BA8F949@DB6PR0101MB2214.eurprd01.prod.exchangelabs.com
State Accepted
Commit 5ad29e15908523c423c881bce2aaf62e433169b6
Headers show
Series [FFmpeg-devel,01/39] avcodec/hevcdsp: Constify src pointers | expand


Context Check Description
yinshiyou/make_loongarch64 fail Make failed
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Andreas Rheinhardt July 26, 2022, 10:07 p.m. UTC
Modifying the main context from a slice thread is (usually)
a data race, so it must not happen. So only use a pointer to const
to access the main context.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
 libavcodec/dxv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series


diff --git a/libavcodec/dxv.c b/libavcodec/dxv.c
index b3df00a5d8..2a055a3438 100644
--- a/libavcodec/dxv.c
+++ b/libavcodec/dxv.c
@@ -193,7 +193,7 @@  static int yao_block(uint8_t *plane0, ptrdiff_t stride0,
 static int decompress_texture_thread(AVCodecContext *avctx, void *arg,
                                      int slice, int thread_nb)
-    DXVContext *ctx = avctx->priv_data;
+    const DXVContext *ctx = avctx->priv_data;
     AVFrame *frame = arg;
     const uint8_t *d = ctx->tex_data;
     int w_block = avctx->coded_width / ctx->texture_block_w;