diff options
author | dvdli <dvdli@google.com> | 2020-10-29 16:32:44 +0800 |
---|---|---|
committer | dvdli <dvdli@google.com> | 2020-10-29 16:32:44 +0800 |
commit | dbb6ba612745097ffc317fff327a5408ea17bbc5 (patch) | |
tree | 346a04acc846f75e590b3404ec3babf83fbd4c0c /src | |
parent | b39234c6a35378abb18e81ea0967331f68fd9029 (diff) |
AOSP CL "tinyalsa: check for NULL mmap_status"
https://android.googlesource.com/platform/external/tinyalsa/+/62644f7a3c4cfa18d7935f731cf59b675669d17a
commit 62644f7a3c4cfa18d7935f731cf59b675669d17a
author Phil Burk <philburk@google.com>
tinyalsa: check for NULL mmap_status
pcm_mmap_get_hw_ptr() was not checking pcm->mmap_status and
crashed when it was NULL.
Bug: 64346189
Test: input_monitor.cpp, see bug report for repro steps
Change-Id: I8436686a231eb01a82dd28ca2cce561d5460bcd6
Diffstat (limited to 'src')
-rw-r--r-- | src/pcm.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -1575,6 +1575,9 @@ int pcm_mmap_get_hw_ptr(struct pcm* pcm, unsigned int *hw_ptr, struct timespec * if (rc < 0) return oops(pcm, errno, "pcm_sync_ptr failed"); + if (pcm->mmap_status == NULL) + return oops(pcm, EINVAL, "pcm %p, mmap_status is NULL", pcm); + if ((pcm->mmap_status->state != PCM_STATE_RUNNING) && (pcm->mmap_status->state != PCM_STATE_DRAINING)) return oops(pcm, ENOSYS, "invalid stream state %d", pcm->mmap_status->state); |