58a1d86c05
The deduced return type is `grs_bitmap`, which is inefficient, but not wrong on its own. However, `rle_expand_texture` uses the address of its argument as a long-term cache key, so it must never be called with the address of a stack-local variable. When the return type is `grs_bitmap`, the argument to `rle_expand_texture` is a reference to a stack-local variable. Fix this by setting the return type to `const grs_bitmap &`, so that the argument to `rle_expand_texture` is a reference to an element in the global GameBitmaps array. AlumiuN proposed an initial fix, but based on analysis of why that fix worked, I elected to use a different, smaller, fix instead. Reported-by: CHILLYBUS <https://github.com/dxx-rebirth/dxx-rebirth/issues/588> Reported-by: KynikossDragonn <https://github.com/dxx-rebirth/dxx-rebirth/issues/588#issuecomment-825978696> Analyzed-by: AlumiuN <https://github.com/dxx-rebirth/dxx-rebirth/issues/588#issuecomment-826009993> Analyzed-by: 4C1T <https://github.com/dxx-rebirth/dxx-rebirth/issues/588#issuecomment-826016402> Proposed-fix-by: AlumiuN < |
||
---|---|---|
.. | ||
2d | ||
3d | ||
arch | ||
editor | ||
main | ||
misc |