Re: [hatari-devel] SCC_UnInit closing uninitialized handles in 2.5.0

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Hi,

On 30.4.2024 23.25, Brad Smith wrote:
SCC_Init fails to initialize ReadHandle_Lan/WriteHandle_Lan for the second
channel to -1 but SCC_UnInit will later try to close(0) for these. This
causes a crash when my libretro core version is closed for the second time,
and 0 has already been closed. Closing 0 was already a problem, but it's
just not a crash the first time, so it wasn't noticeable in the standalone
version.

The fix is simple, just initialize them:

SCC.Chn[1].ReadHandle_Lan = SCC.Chn[1].WriteHandle_Lan = -1;

https://git.tuxfamily.org/hatari/hatari.git/tree/src/scc.c#n506

Right, those are uninitialized.   I pushed your suggested fix.


	- Eero



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/