[MMIXER] Fix NULL dereference CORE-17276
authorJoachim Henze <Joachim.Henze@reactos.org>
Tue, 15 Sep 2020 18:54:50 +0000 (20:54 +0200)
committerJoachim Henze <Joachim.Henze@reactos.org>
Tue, 15 Sep 2020 18:54:50 +0000 (20:54 +0200)
This lead to a crash of winmm:mixer
during "GCCLin_x86 on Test VBox".

The crash was exposed when new code paths
were activated by 0.4.15-dev-791-g
6d7ebc20481a587bd19e8a8049317113071b0817

I do intend to port this commit back into 0.4.14RC.

sdk/lib/drivers/sound/mmixer/sup.c

index 06f342b..4fa8c08 100644 (file)
@@ -690,6 +690,8 @@ MMixerSetGetVolumeControlDetails(
 
     /* get input */
     Input = (LPMIXERCONTROLDETAILS_UNSIGNED)MixerControlDetails->paDetails;
+    if (!Input)
+        return MM_STATUS_UNSUCCESSFUL; /* to prevent dereferencing NULL */
 
     if (bSet)
     {