diff --git a/libfreerdp/codec/progressive.c b/libfreerdp/codec/progressive.c index 72f4a3e1263ca..e72cd40f3f5cd 100644 --- a/libfreerdp/codec/progressive.c +++ b/libfreerdp/codec/progressive.c @@ -1771,14 +1771,13 @@ static INLINE SSIZE_T progressive_process_tiles(PROGRESSIVE_CONTEXT* progressive for (index = 0; index < region->numTiles; index++) { RFX_PROGRESSIVE_TILE* tile = region->tiles[index]; - PROGRESSIVE_TILE_PROCESS_WORK_PARAM* param = ¶ms[index]; - param->progressive = progressive; - param->region = region; - param->context = context; - param->tile = tile; if (progressive->rfx_context->priv->UseThreads) { + params[index].progressive = progressive; + params[index].region = region; + params[index].context = context; + params[index].tile = tile; if (!(work_objects[index] = CreateThreadpoolWork( progressive_process_tiles_tile_work_callback, (void*)¶ms[index], &progressive->rfx_context->priv->ThreadPoolEnv))) @@ -1793,7 +1792,13 @@ static INLINE SSIZE_T progressive_process_tiles(PROGRESSIVE_CONTEXT* progressive } else { - progressive_process_tiles_tile_work_callback(0, ¶ms[index], 0); + PROGRESSIVE_TILE_PROCESS_WORK_PARAM param = { + .progressive = progressive, + .region = region, + .context = context, + .tile = tile + }; + progressive_process_tiles_tile_work_callback(0, ¶m, 0); } if (status < 0)