Merge "Fix uninitialized crypto pattern" into nyc-dev

This commit is contained in:
Jeff Tinker
2016-03-04 01:35:52 +00:00
committed by Android (Google) Code Review

View File

@@ -1302,7 +1302,10 @@ static void android_media_MediaCodec_queueSecureInputBuffer(
jobject patternObj = env->GetObjectField(cryptoInfoObj, gFields.cryptoInfoPatternID);
CryptoPlugin::Pattern pattern;
if (patternObj != NULL) {
if (patternObj == NULL) {
pattern.mEncryptBlocks = 0;
pattern.mSkipBlocks = 0;
} else {
pattern.mEncryptBlocks = env->GetIntField(patternObj, gFields.patternEncryptBlocksID);
pattern.mSkipBlocks = env->GetIntField(patternObj, gFields.patternSkipBlocksID);
}