summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorWei Jia <wjia@google.com>2015-04-16 15:02:13 -0700
committerWei Jia <wjia@google.com>2015-04-16 15:46:16 -0700
commit9767a47dcf9bbe090045ab99e0290d73289c704f (patch)
tree9319d521eabb9083603b2989d5abe848727b80ff /media
parent3d66eb4128aebef31bb0fa44c4d53d6122294a26 (diff)
downloadframeworks_av-9767a47dcf9bbe090045ab99e0290d73289c704f.zip
frameworks_av-9767a47dcf9bbe090045ab99e0290d73289c704f.tar.gz
frameworks_av-9767a47dcf9bbe090045ab99e0290d73289c704f.tar.bz2
MediaSync: sanity check native sample rate.
Bug: 19666434 Change-Id: I0eb7a70c81c4fcc336f52f014eeb6d261ac2c501
Diffstat (limited to 'media')
-rw-r--r--media/libstagefright/MediaSync.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/media/libstagefright/MediaSync.cpp b/media/libstagefright/MediaSync.cpp
index 7b6c7d9..ec956c4 100644
--- a/media/libstagefright/MediaSync.cpp
+++ b/media/libstagefright/MediaSync.cpp
@@ -115,6 +115,11 @@ status_t MediaSync::configureAudioTrack(
return INVALID_OPERATION;
}
+ if (audioTrack != NULL && nativeSampleRateInHz <= 0) {
+ ALOGE("configureAudioTrack: native sample rate should be positive.");
+ return BAD_VALUE;
+ }
+
mAudioTrack = audioTrack;
mNativeSampleRateInHz = nativeSampleRateInHz;