summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorDeva Ramasubramanian <dramasub@codeaurora.org>2011-04-22 13:22:00 -0700
committerSteve Kondik <shade@chemlab.org>2011-11-13 19:37:17 -0800
commitbb66da2faf86f7be8d349fd8f9bfc1e364ebf820 (patch)
tree6e441a91ebcafc917448ea67e07d31ca0f3dd420 /media
parent660f76325a035b0c2b9372b012a54eae59671f8f (diff)
downloadframeworks_base-bb66da2faf86f7be8d349fd8f9bfc1e364ebf820.zip
frameworks_base-bb66da2faf86f7be8d349fd8f9bfc1e364ebf820.tar.gz
frameworks_base-bb66da2faf86f7be8d349fd8f9bfc1e364ebf820.tar.bz2
libstagefright: Fix crash when generating thumbnails for AVI & h264 clips
If parser fails to identify a sample to use for thumbnail generation and the client doesn't want thumbnail from any specific timestamp (i.e. passes in negative timestamp), an assertion in software decoder will fail because the software decoder attempts to start decoding from a negative timestamp. So instead, we'll pick up the thumbnail from timestamp 0, which we expect to be an i-frame. CRs-Fixed: 284873 (cherry picked from commit 23d7b006f81ac2ffbc3866f0a730a6ce823763c6) Change-Id: I626fc8e322ceb2b2d9e848ebc12423e6f739f635
Diffstat (limited to 'media')
-rw-r--r--media/libstagefright/StagefrightMetadataRetriever.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/media/libstagefright/StagefrightMetadataRetriever.cpp b/media/libstagefright/StagefrightMetadataRetriever.cpp
index 24fac7f..6e76650 100644
--- a/media/libstagefright/StagefrightMetadataRetriever.cpp
+++ b/media/libstagefright/StagefrightMetadataRetriever.cpp
@@ -178,7 +178,7 @@ static VideoFrame *extractVideoFrameWithCodecFlags(
options.setSeekTo(thumbNailTime, mode);
} else {
thumbNailTime = -1;
- options.setSeekTo(frameTimeUs, mode);
+ options.setSeekTo(frameTimeUs < 0 ? 0 : frameTimeUs, mode);
}
MediaBuffer *buffer = NULL;