Make sure the decoder's input buffers are large enough to hold the largest input data. Verify that the setting actually sticks.
diff --git a/media/libstagefright/OMXCodec.cpp b/media/libstagefright/OMXCodec.cpp
index 9297aff0..10a4986 100644
--- a/media/libstagefright/OMXCodec.cpp
+++ b/media/libstagefright/OMXCodec.cpp
@@ -462,7 +462,7 @@
     }
 
     int32_t maxInputSize;
-    if (createEncoder && meta->findInt32(kKeyMaxInputSize, &maxInputSize)) {
+    if (meta->findInt32(kKeyMaxInputSize, &maxInputSize)) {
         codec->setMinBufferSize(kPortIndexInput, (OMX_U32)maxInputSize);
     }
 
@@ -487,12 +487,18 @@
 
     if (def.nBufferSize < size) {
         def.nBufferSize = size;
-
     }
 
     err = mOMX->setParameter(
             mNode, OMX_IndexParamPortDefinition, &def, sizeof(def));
     CHECK_EQ(err, OK);
+
+    err = mOMX->getParameter(
+            mNode, OMX_IndexParamPortDefinition, &def, sizeof(def));
+    CHECK_EQ(err, OK);
+
+    // Make sure the setting actually stuck.
+    CHECK(def.nBufferSize >= size);
 }
 
 status_t OMXCodec::setVideoPortFormatType(