Skip to content

Bug in example: getTimestamp(), FilterAudioStream.h needs a NULL check on framePosition #1166

Closed

Description

I was ready to write a crash report on Oboe 1.5.0, when I realized that my code calling getTimestamp(CLOCK_MONOTONIC, 0, 0) was wrong. I thought I probably copied it quite some time ago from example code and indeed, PlayAudioEngine.cpp of the hello-oboe sample contains it as well:

mIsLatencyDetectionSupported = (mPlayStream->getTimestamp(CLOCK_MONOTONIC, 0, 0) !=
oboe::Result::ErrorUnimplemented);

In FilterAudioStream.h, this leads to a crash in:
*framePosition = childPosition * mRateScaler;
or perhaps
getTimeStamp(clockId, &childPosition, timeNanoseconds);
if something is done using timeNanoseconds in that call.

Don't know why it survived in my app all the time and only started crashing with 1.5.0, but perhaps some null pointer checks are in order here. At least the sample code should be changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

P1high prioritybug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions