sample{,_muxer}: check SegmentInfo::GetInfo() return

prevents a segfault when parsing a corrupt file

BUG=23430793

Change-Id: I909fd456555ed0d5d871e12258b4887f36f90867
This commit is contained in:
James Zern 2015-08-21 16:56:32 -07:00
parent 07a9cf7127
commit d9bdadeff8
2 changed files with 8 additions and 0 deletions

View File

@ -110,6 +110,10 @@ int main(int argc, char* argv[]) {
}
const SegmentInfo* const pSegmentInfo = pSegment->GetInfo();
if (pSegmentInfo == NULL) {
printf("\n Segment::GetInfo() failed.");
return -1;
}
const long long timeCodeScale = pSegmentInfo->GetTimeCodeScale();
const long long duration_ns = pSegmentInfo->GetDuration();

View File

@ -264,6 +264,10 @@ int main(int argc, char* argv[]) {
}
const mkvparser::SegmentInfo* const segment_info = parser_segment->GetInfo();
if (segment_info == NULL) {
printf("\n Segment::GetInfo() failed.");
return EXIT_FAILURE;
}
const long long timeCodeScale = segment_info->GetTimeCodeScale();
// Set muxer header info