diff options
author | Phil Burk <philburk@google.com> | 2017-08-09 04:13:12 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-08-09 04:13:12 +0000 |
commit | 0845281f59a28260ad0094d11d981624d7059186 (patch) | |
tree | dff1f0c0da12c482bd5407cd5eedf497d50a1271 | |
parent | 98fc9a32d0efe5e3335fdd3e41d9b3b1e158d150 (diff) | |
parent | 62644f7a3c4cfa18d7935f731cf59b675669d17a (diff) | |
download | tinyalsa-0845281f59a28260ad0094d11d981624d7059186.tar.gz |
tinyalsa: check for NULL mmap_status
am: 62644f7a3c
Change-Id: Ib768dcdf259e4881dae884b0c1100ae3e01424eb
-rw-r--r-- | pcm.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -500,6 +500,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); |