Merge "Backward-compatibility max file size support, ignoring 0 or negative file size limit"
diff --git a/media/libstagefright/OMXCodec.cpp b/media/libstagefright/OMXCodec.cpp
index 69ab75a..352f9fb 100644
--- a/media/libstagefright/OMXCodec.cpp
+++ b/media/libstagefright/OMXCodec.cpp
@@ -1536,7 +1536,9 @@
     }
 
     err = allocateBuffers();
-    CHECK_EQ(err, (status_t)OK);
+    if (err != (status_t)OK) {
+        return err;
+    }
 
     if (mQuirks & kRequiresLoadedToIdleAfterAllocation) {
         err = mOMX->sendCommand(mNode, OMX_CommandStateSet, OMX_StateIdle);