Skip to content
  • Steinar H. Gunderson's avatar
    Fix demuxing of non-fastseekable MP4 files over 2 GB. · f9dc591a
    Steinar H. Gunderson authored and François Cartegnie's avatar François Cartegnie committed
    An uint64_t is implicity cast to an int and then checked for >= 0; ostensibly
    to see if stream_Tell() failed, but once the file passes 2 GB, wraparound
    kicks in and the check fails. Somehow this worked fine for local files, but not
    for non-fastseekable ones (e.g. from HTTP).
    
    Fixes #16800. Quoting myself from the bug:
    
    Seemingly this code was introduced in ba3a2185 (May 2015), before stream_Tell()
    was made to never be able to fail and thus return unsigned (in 48786ae5, Aug
    2015). It seems it deliberately wanted the variable to be signed (it even casts
    it back to uint64_t on the next line), but missed that it ought to be 64 bits.
    dfd028fe
    
     (Oct 2015) removed the helper function MP4_stream_Tell(), but I
    suppose that since this instance called stream_Tell() directly without going
    through the helper, it was missed.
    
    Signed-off-by: default avatarFrancois Cartegnie <fcvlcdev@free.fr>
    f9dc591a