sample{,_muxer}: check SegmentInfo::GetInfo() return
prevents a segfault when parsing a corrupt file BUG=23430793 Change-Id: I909fd456555ed0d5d871e12258b4887f36f90867
This commit is contained in:
@@ -110,6 +110,10 @@ int main(int argc, char* argv[]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const SegmentInfo* const pSegmentInfo = pSegment->GetInfo();
|
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 timeCodeScale = pSegmentInfo->GetTimeCodeScale();
|
||||||
const long long duration_ns = pSegmentInfo->GetDuration();
|
const long long duration_ns = pSegmentInfo->GetDuration();
|
||||||
|
|||||||
@@ -264,6 +264,10 @@ int main(int argc, char* argv[]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const mkvparser::SegmentInfo* const segment_info = parser_segment->GetInfo();
|
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();
|
const long long timeCodeScale = segment_info->GetTimeCodeScale();
|
||||||
|
|
||||||
// Set muxer header info
|
// Set muxer header info
|
||||||
|
|||||||
Reference in New Issue
Block a user