demux/mkv: fix 17567: null-pointer dereference in EnsureDuration
authorFilip Roséen <filip@atch.se>
Fri, 4 Nov 2016 15:47:07 +0000 (16:47 +0100)
committerThomas Guillem <thomas@gllm.fr>
Fri, 4 Nov 2016 16:11:38 +0000 (17:11 +0100)
commit8ad7d9ceaf57149dfcd6903560007f354274f727
treef4193bf89231c09d7bacae8dbc0ae7ba05c6d638
parent55d4aff67f9b74bc47c3258a9452fb8a5e17457b
demux/mkv: fix 17567: null-pointer dereference in EnsureDuration

Since matroska_segment_c::EnsureDuration calculates the duration by
using the timecode of the last block in the last cluster, and
subtracting that with the timecode of the first cluster found, the
previous implementation would crash if there was no clusters in the
file.

These changes fixes that, and should be viewed as a fixup of f275663.

fixes #17567

Signed-off-by: Steve Lhomme <robux4@videolabs.io>
Signed-off-by: Thomas Guillem <thomas@gllm.fr>
modules/demux/mkv/matroska_segment.cpp