Skip to content
  • Filip Roséen's avatar
    demux/asf: prevent overflow leading to crash (fixes #17580) · c06adddc
    Filip Roséen authored and Rémi Denis-Courmont's avatar Rémi Denis-Courmont committed
    
    
    Given that the previous implementation assigned the return-value of
    vlc_stream_Peek to a size_t, the value would wrap around on error
    (since vlc_stream_Peek returns -1), rendering the "< 78" somewhat
    useless (when an error occurs).
    
    These changes change the type of i_peek to correspond to that of
    vlc_stream_Peek, while also making sure that we error before calling
    the function if the object size is larger than SSIZE_MAX (meaning that
    we cannot peek).
    
    Signed-off-by: default avatarRémi Denis-Courmont <remi@remlab.net>
    c06adddc