From 4fffa0ff6ab7777db634b3f0cb9b38525a801169 Mon Sep 17 00:00:00 2001 From: Edwin Wong Date: Tue, 25 Sep 2012 23:05:05 -0700 Subject: [PATCH] Fixed mediacodec mode's fatal error when eos is encountered. The FATAL EXCEPTION is caused by the decrypt function returning -EINVAL when OEMCrypto decrypt returns an error. The fix is not to call OEMCrypto decrypt when eos is reached. related-to-bug: 7216928 related-to-bug: 7217609 Change-Id: I8f006905386e2cdfb907d4ab15c766ae69f20f00 Signed-off-by: Iliyan Malchev --- proprietary/cryptoPlugin/WVCryptoPlugin.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/proprietary/cryptoPlugin/WVCryptoPlugin.cpp b/proprietary/cryptoPlugin/WVCryptoPlugin.cpp index b5098114..215c2889 100644 --- a/proprietary/cryptoPlugin/WVCryptoPlugin.cpp +++ b/proprietary/cryptoPlugin/WVCryptoPlugin.cpp @@ -120,6 +120,9 @@ ssize_t WVCryptoPlugin::decrypt( } //ALOGD("size[%d]=%d", i, srcSize); + if (srcSize == 0) { + continue; // segment size is zero, do not call decrypt + } #ifdef REQUIRE_SECURE_BUFFERS // decrypt using OEMCrypto API, used for L1 devices