8000 Bug in example: getTimestamp(), FilterAudioStream.h needs a NULL check on framePosition · Issue #1166 · google/oboe · GitHub
[go: up one dir, main page]

Skip to content

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

@extreamsd

Description

@extreamsd

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.

Metadata

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

    0