demux: mp4: rewrite stts/ctts processing
demux: mp4: rewrite stts/ctts processing

in a way to get rid of most limits checks.
Fixes the corner case where i_rest was always 0 and
the index kept incrementing (source of prev oob access)

xkfz007/vlc,krichter722/vlc,shyamalschandra/vlc,shyamalschandra/vlc,jomanmuk/vlc-2.2,jomanmuk/vlc-2.2,xkfz007/vlc,jomanmuk/vlc-2.2,shyamalschandra/vlc,jomanmuk/vlc-2.2,xkfz007/vlc,jomanmuk/vlc-2.2,xkfz007/vlc,krichter722/vlc,vlc-mirror/vlc,krichter722/vlc,vlc-mirror/vlc,vlc-mirror/vlc,shyamalschandra/vlc,vlc-mirror/vlc,krichter722/vlc,krichter722/vlc,shyamalschandra/vlc,xkfz007/vlc,jomanmuk/vlc-2.2,vlc-mirror/vlc,xkfz007/vlc,shyamalschandra/vlc,shyamalschandra/vlc,krichter722/vlc,vlc-mirror/vlc,jomanmuk/vlc-2.2,xkfz007/vlc,krichter722/vlc,vlc-mirror/vlc