According to the specification of nsv, a file header size of 0 (and
0xFFFFFFFF) is invalid; these changes prevents an infinite loop if the
size is specified as the former, while also making sure that we do not
try to parse files containing the latter.
- http://multimedia.cx/nsv-format.txt
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
av_read_frame expects 0 to be returned on end-of-file, and negative
values are reserved for fatal stream-errors. The previous
implementation would return -1 upon EOF (vlc_stream_Read returning 0),
causing premature EOF from modules/demux/avformat/demux.c:Demux.
These changes make sure that we honor the contract associated with the
read-callback, and that we only return -1 if there is a fatal error.
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
FromACP is used to convert a c-style string from one charset to the
other, as such it does not make sense to call the function with NULL
(especially given that NULL is not a valid input for the function).
These changes fixes the checks to see whether or not the function is
applicable or not by properly checking the argument that would-be
passed (instead of just the object that contains it).
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
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: Rémi Denis-Courmont <remi@remlab.net>
The previous implementation could overflow the mtime_t when
multiplying p_sys->p_fp->i_preroll by a thousand when converting from
the asf time unit (milliseconds) to VLCs (microseconds).
Given that you can always divide a value without running into issues
in terms of under/overflow, these changes prevent any overflow error
while still preserving the same logic.
In short the implementation takes advantage of the below two
conditions being equivalent:
1: A > ( ( B * C ) + D )
2: ( ( A - D ) / C ) > B
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
On Apple platforms, ALPN does not work as securetransport does
not provide any public API for that. So do not check for that
feature until support is added.
Makes main demux aware of interleaving, and avoid
access layer seeks. Also improves the large interleaves
and non interleaved playback.
Fixes the pcr jumps, as a min() dts based logic isn't
suitable for edit lists.
Improves empty edits handling by keeping demuxing on
empty samples time.
The result of a read operation is a signed size_t, and cannot be
negative (except on error). Thus reading more than SSIZE_MAX bytes at
once is not well defined.
(Note: POSIX marks it as implementation-defined, and we cannot rely on
much given the different implementations.)
In practice, this is not really a limitation for regular reads as
allocating a contiguous output buffer of more than SSIZE_MAX bytes is
essentially impossible. It can however be a problem when skipping data
(buffer pointer is NULL), especially on 32-bits platforms.
To skip such large amount of data, seeking is recommended instead,
e.g.:
vlc_stream_Seek(s, vlc_stream_Tell() + skip);
instead of:
vlc_stream_Read(s, NULL, skip);
This will add a fallback mechanism that uses a
normal layer-backed NSView with a dark but still
slightly transparent background on macOS versions
that do not support NSVisualEffectView.
Additionally it will allow compilation with older
SDK's that have no NSVisualEffectView defined.
If compiled with such an SDK, support for
NSVisualEffectView is disabled completely, so
even when running the compiled VLC version
on 10.10 or higher it will use the old fallback
view, as the SDK it was compiled with had not the
necessary definitions.
This introduces a new fullscreen controller
which uses NSVisualEffectView for it's background
and the icons that are used throughout the rest of
the macOS user interface, hence making it more
consistent with the overall look of VLC.
Additionally the new fullscreen controller is
resizable and, as it already used to be, can be
move around on the screen.
The user interface is now described in a interface
builder file (xib) instead of doing everything in
code. This allows easy usage of autolayout, which
is heavily used to allow adaption of the
buttons/sliders depending on the panel width and
height.
This adds MACOSX_DEPLOYMENT_TARGET (which will be set to the value of
the MIN_OSX_VERSION variable) so contribs that only use xcodebuild
(like BGHUDKit) will use the correct deployment target.
The function should provide interrupt DNS resolution, so a thread can
abort a DNS query (e.g. if network is down or really slow).
The stub is not interruptible. This makes no difference to the existing
uninterruptible (mis)behaviour.