Loading media/jni/android_media_MediaExtractor.cpp +11 −0 Original line number Diff line number Diff line Loading @@ -196,6 +196,15 @@ status_t JMediaExtractor::readSampleData( dstSize = (size_t) env->GetDirectBufferCapacity(byteBuf); } // unlikely, but GetByteArrayElements() can fail if (dst == nullptr) { ALOGE("no buffer into which to read the data"); if (byteArray != NULL) { env->ReleaseByteArrayElements(byteArray, (jbyte *)dst, 0); } return -ENOMEM; } if (dstSize < offset) { if (byteArray != NULL) { env->ReleaseByteArrayElements(byteArray, (jbyte *)dst, 0); Loading @@ -204,8 +213,10 @@ status_t JMediaExtractor::readSampleData( return -ERANGE; } // passes in the backing memory to use, so it doesn't fail sp<ABuffer> buffer = new ABuffer((char *)dst + offset, dstSize - offset); buffer->setRange(0, 0); // mark it empty status_t err = mImpl->readSampleData(buffer); if (byteArray != NULL) { Loading Loading
media/jni/android_media_MediaExtractor.cpp +11 −0 Original line number Diff line number Diff line Loading @@ -196,6 +196,15 @@ status_t JMediaExtractor::readSampleData( dstSize = (size_t) env->GetDirectBufferCapacity(byteBuf); } // unlikely, but GetByteArrayElements() can fail if (dst == nullptr) { ALOGE("no buffer into which to read the data"); if (byteArray != NULL) { env->ReleaseByteArrayElements(byteArray, (jbyte *)dst, 0); } return -ENOMEM; } if (dstSize < offset) { if (byteArray != NULL) { env->ReleaseByteArrayElements(byteArray, (jbyte *)dst, 0); Loading @@ -204,8 +213,10 @@ status_t JMediaExtractor::readSampleData( return -ERANGE; } // passes in the backing memory to use, so it doesn't fail sp<ABuffer> buffer = new ABuffer((char *)dst + offset, dstSize - offset); buffer->setRange(0, 0); // mark it empty status_t err = mImpl->readSampleData(buffer); if (byteArray != NULL) { Loading