When generating chapters mkvmerge has to take into account things such
as splitting and file linking. This requires shifting chapter
timestamps to match file timestamps. However, for files which don't
start at 0 generated chapters would be wrongfully shifted down to
below 0 causing invalid timestamps.
Fixes#2432.
This method works for systems where a logind-compatible D-Bus
interface is available for inhibiting sleep & idle states. Requires
Qt's D-Bus library.
Part of the implementation of #2411.
As Qt provides its own interface for reporting progress via task bar
icons, these Windows interface definition aren't needed anymore. They
were need back when mmg was a thing.
The default target for debug messages writes to standard output. This
will end up in nirvana for GUI applications on Windows that don't have
a console allocated — such as MKVToolNix GUI. Therefore always send it
via the logger class, whose default target is Windows' debugging
facility allowing capture via DebugView.
There's a catch 22 type situation: the `Util::Settings` class requires
the `Application` class to have been instantiated in order to set a
lot of default values when the ini file doesn't exist or when certain
settings don't exist in it. However, the DPI scaling must be set
before the `Application` class is instantiated, and that setting is
stored in said ini file.
As a workaround read this one setting from the ini file directly
without slurping the whole ini file into the `Util::Settings`
instance. This only requires an instance of `QSettings` which, in
turn, only requires that the organization name & domain as well as the
application name have been set in `QApplication`.
Fixes#2424.
The resource compiler includes identifiers that aren't defined as
preprocessor symbols verbatim as strings. Normally `RT_MANIFEST` is
defined as the integer resource 24, but if the header file where it is
defined (`winuser.h`) isn't included, the verbatim string
`RT_MANIFEST` will be used silently.
See #2415.
Older libEBML or libMatroska versions don't validate the parent/child
sizes properly. This means that tests running on those older versions
cause mkvinfo to fail (with an exception = harmlessly).
The `EbmlElement::Read` function returns two values via reference
parameters. They're called `UpperEltFound` (an integer) and
`FoundElt` (a pointer to an EBML element). They're used for passing
back the first element found (if any) that is not a child of the
element currently being read so that the calling code can continue
parsing the file using the upper-level element.
If the calling code doesn't need that element, it has to delete it
itself. However, the code must not simply rely on the `FoundElt`
pointer being not null as the `Read` function assigns temporary
results to that variable. Depending on the file content, that
temporary element may have already been deleted by the `Read`
function. When the calling code then simply deletes `FoundElt` itself,
this leads to a typical case of use-after-free.
Instead the calling code must only work with the returned `FoundElt`
pointer if the other returned value, `UpperEltFound`, trueish in the
C++ sense (if it isn't 0). Then and only then may the calling code
attempt to delete the object `FoundElt` points to.
This vulnerability allows arbitrary code execution via specially
crafted Matroska files. It was reported by Cisco TALOS on 2018-10-25
and is known as TALOS 2018-0694.