The two types of packets (PCI and DSI) are passed untouched but combined by the new codec ID AV_CODEC_ID_DVD_NAV.
The first 980 bytes in the packet contain the PCI data. The next 1018 are the DSI data.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This is admittedly kind of pointless since usually -f image2pipe
can be used for the purpose, but this is more user-friendly.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Otherwise ffmpeg -formats claims that we only support demuxing
of that format.
To keep compatibility the struct could be duplicated instead,
but this seems almost like overkill for such a rare format.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
- Make MultiByteToWideChar fail when it encounters invalid encoding.
Without this, invalid characters might just be skipped
- When MultiByteToWideChar fails, assume the file name is in CP_ACP
and open it via normal open function, even when the file will be
written
- When malloc fails return error instead of crashing
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
To avoid allocating ridiculous amounts of memory for corrupted files,
read the input in chunks limited to filesize or an arbitrary large
amount when that is not known (chosen to be 50M).
Simplify `p->buf > p->buf + p->buf_size - 4' as `p->buf_size < 4'.
Avoid a possible out-of-bounds pointer, which is undefined behavior
in C.
CC: libav-stable@libav.org
Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
When parsing the Xing/Info tag, don't set the bit rate if it's an Info tag.
When parsing the stream, don't override the bit rate if it's already set,
otherwise calculate the mean bit rate from parsed frames. This way, the bit
rate will be set correctly both for CBR and VBR streams.
CC:libav-stable@libav.org
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Fixes use of uninitialized variables and possible out of array accesses
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This reverts commit 6cc12353a8.
Conflicts:
libavformat/version.h
Allowing to automatically select the concat demuxer raises
security concerns, as it allows a possibly hostile file to
access any file on the system. Guessing the format based on
the file name extension does not allow to enable the safe
mode designed to avoid it.
When parsing the Xing/Info tag, don't set the bit rate if it's an Info tag.
When parsing the stream, don't override the bit rate if it's already set,
otherwise calculate the mean bit rate from parsed frames. This way, the bit
rate will be set correctly both for CBR and VBR streams.
Signed-off-by: Alexander Kojevnikov <alexander@kojevnikov.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>