[MPlayer-cvslog] r38414 - trunk/libao2/ao_sndio.c

al subversion at mplayerhq.hu
Sat Apr 8 22:42:21 EEST 2023


Author: al
Date: Sat Apr  8 22:42:20 2023
New Revision: 38414

Log:
ao_sndio: fix a crash when exiting in muted state

Muting mplayer with 'm', then hitting '<enter>' segfaults mplayer since it
tries to unmute itself after uninitializing the sndio backend. Clear the
havevol flag on uninit() to block subsequent AOCONTROL_{GET,SET}_VOLUME
operations.

Other aos are affected by this problematic call too.
Generally this shouldn't happen and will be covered by follow up patches.

Fix suggested by and ok ratchov

Patch from Theo Buehler >tb openbsd org<

Modified:
   trunk/libao2/ao_sndio.c

Modified: trunk/libao2/ao_sndio.c
==============================================================================
--- trunk/libao2/ao_sndio.c	Sat Mar 25 19:10:41 2023	(r38413)
+++ trunk/libao2/ao_sndio.c	Sat Apr  8 22:42:20 2023	(r38414)
@@ -159,6 +159,7 @@ err_out:
     pfds = NULL;
     sio_close(hdl);
     hdl = NULL;
+    havevol = 0;
     return 0;
 }
 
@@ -172,6 +173,7 @@ static void uninit(int immed)
     hdl = NULL;
     free(pfds);
     pfds = NULL;
+    havevol = 0;
 }
 
 /*


More information about the MPlayer-cvslog mailing list