Merge "Properly forward errors returned by AudioTrack up to the player."
diff --git a/media/libstagefright/codecs/avc/dec/AVCDecoder.cpp b/media/libstagefright/codecs/avc/dec/AVCDecoder.cpp
index 36272ea..aa2a3d1 100644
--- a/media/libstagefright/codecs/avc/dec/AVCDecoder.cpp
+++ b/media/libstagefright/codecs/avc/dec/AVCDecoder.cpp
@@ -322,8 +322,10 @@
                 crop_top = crop_left = 0;
             }
 
-            mFormat->setInt32(kKeyWidth, crop_right - crop_left + 1);
-            mFormat->setInt32(kKeyHeight, crop_bottom - crop_top + 1);
+            int32_t aligned_width = (crop_right - crop_left + 1 + 15) & ~15;
+            int32_t aligned_height = (crop_bottom - crop_top + 1 + 15) & ~15;
+            mFormat->setInt32(kKeyWidth, aligned_width);
+            mFormat->setInt32(kKeyHeight, aligned_height);
 
             mInputBuffer->release();
             mInputBuffer = NULL;