From 66f155502d35a71baf59e253af82421368d8e725 Mon Sep 17 00:00:00 2001 From: KongQun Yang Date: Wed, 16 Jul 2014 19:35:00 -0700 Subject: [PATCH] Fix packager failure if there is only one sample in a fragment That is a very corner corner case. Change-Id: I45bc6c2d41db2a666a4ad997e4bf2eb17843e3ea --- media/formats/mp4/track_run_iterator.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/media/formats/mp4/track_run_iterator.cc b/media/formats/mp4/track_run_iterator.cc index 510e6630c2..b6c82d93c2 100644 --- a/media/formats/mp4/track_run_iterator.cc +++ b/media/formats/mp4/track_run_iterator.cc @@ -446,7 +446,7 @@ int64 TrackRunIterator::GetMaxClearOffset() { } } if (offset == kint64max) - return 0; + return runs_.empty() ? 0 : runs_[0].sample_start_offset; return offset; }