summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xmedia/libstagefright/SkipCutBuffer.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/media/libstagefright/SkipCutBuffer.cpp b/media/libstagefright/SkipCutBuffer.cpp
index 773854f..4d15d7e 100755
--- a/media/libstagefright/SkipCutBuffer.cpp
+++ b/media/libstagefright/SkipCutBuffer.cpp
@@ -25,6 +25,13 @@
namespace android {
SkipCutBuffer::SkipCutBuffer(int32_t skip, int32_t cut) {
+
+ if (skip < 0 || cut < 0 || cut > 64 * 1024) {
+ ALOGW("out of range skip/cut: %d/%d, using passthrough instead", skip, cut);
+ skip = 0;
+ cut = 0;
+ }
+
mFrontPadding = skip;
mBackPadding = cut;
mWriteHead = 0;