summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorJames Dong <jdong@google.com>2010-12-15 17:32:45 -0800
committerJames Dong <jdong@google.com>2010-12-15 17:40:08 -0800
commitc9e1c80f786667e264748bf2843dabdc2029c006 (patch)
tree9fd0b9365c776d794e09150e31c944a6858a00b5 /media
parentb146b1214ef6e4fc75d98779b22434335764cfdb (diff)
downloadframeworks_base-c9e1c80f786667e264748bf2843dabdc2029c006.zip
frameworks_base-c9e1c80f786667e264748bf2843dabdc2029c006.tar.gz
frameworks_base-c9e1c80f786667e264748bf2843dabdc2029c006.tar.bz2
Give the standard not compliant video sample a chance if its size in the mp4 header is invalid
Change-Id: Ib573ededb9c73285822fa238120faa484402bcf7
Diffstat (limited to 'media')
-rw-r--r--media/libstagefright/MPEG4Extractor.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/media/libstagefright/MPEG4Extractor.cpp b/media/libstagefright/MPEG4Extractor.cpp
index d3c7445..dfc9b5a 100644
--- a/media/libstagefright/MPEG4Extractor.cpp
+++ b/media/libstagefright/MPEG4Extractor.cpp
@@ -959,6 +959,13 @@ status_t MPEG4Extractor::parseChunk(off64_t *offset, int depth) {
uint16_t width = U16_AT(&buffer[6 + 18]);
uint16_t height = U16_AT(&buffer[6 + 20]);
+ // The video sample is not stand-compliant if it has invalid dimension.
+ // Use some default width and height value, and
+ // let the decoder figure out the actual width and height (and thus
+ // be prepared for INFO_FOMRAT_CHANGED event).
+ if (width == 0) width = 352;
+ if (height == 0) height = 288;
+
// printf("*** coding='%s' width=%d height=%d\n",
// chunk, width, height);