audio/null: Fix null pointer dereference
Fix possible null pointer dereference at line 350-354 when 'device' is NULL at line 347. Pointed out by cppcheck. Change-Id: I25a090172a0d17ef3cb1fe607f70a31e579d13b0 Reviewed-on: https://review.haiku-os.org/c/haiku/+/3498 Reviewed-by: Jérôme Duval <[email protected]>
This commit is contained in:
committed by
Adrien Destugues
parent
151de9ff9b
commit
c3427db750
@@ -344,7 +344,10 @@ buffer_force_stop(device_t* device)
|
||||
{
|
||||
dprintf("null_audio: %s\n" , __func__ );
|
||||
|
||||
if (device && device->running)
|
||||
if (device == NULL)
|
||||
return B_ERROR;
|
||||
|
||||
if (device->running)
|
||||
null_stop_hardware(device);
|
||||
|
||||
delete_area(device->playback_stream.buffer_area);
|
||||
|
||||
Reference in New Issue
Block a user