Fixes: runtime error: signed integer overflow: 5 * -2147483647 cannot be represented in type 'int'
Fixes: Chromium bug 817338
Reviewed-by: Matt Wolenetz <wolenetz@google.com>
Reported-by: Matt Wolenetz <wolenetz@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
If there is a decoder initialization failure detected in avcodec_open2
after .init is called, allow graceful decoder .close to prevent leaking
vorbis decoder allocations such as those from vorbis_parse_setup_*.
BUG=772699
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
ff_get_extradata() frees any existing extradata before allocating now,
and using av_free() here leaves a dangling pointer that will result in
a double free.
Fixes a regression since 0ca33b1d4e.
Tested-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
Numeric hosts in certificates are not very common, but supported by LibreSSL.
Forward the IP address to make verification work in this case.
Fixes ticket #7029
This prevents leaks in the rare cases the function is called when extradata
already exists.
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
Look_ahead can provide quality improvements, but would better disable it by default due to some reasons:
1. It is only available for some codecs (e.g. HEVC is not supported) on Intel
Haswell and plus platforms. Thus means it will be failed on some platforms.
2. It significantly increases encoding latency and memory consumption.
3. It may overwrite some other options such as CBR and CAVLC.
Signed-off-by: Zhong Li <zhong.li@intel.com>
Signed-off-by: Mark Thompson <sw@jkqxz.net>
* commit '2d6b3f3a9dce409ca51d70ef4b85c0593bb4b109':
qsvenc: Provide a detailed error message if the parameters are invalid
Merged-by: Mark Thompson <sw@jkqxz.net>
* commit 'e2399e0c1aeb110456405d23e211066fab6cb041':
fate: Error out more gracefully on configure failure
This commit is a noop, the configure failure reporting issue does not
appear to affect FFmpeg.
Merged-by: Mark Thompson <sw@jkqxz.net>
* commit 'dc40e64adb1712b1209c018914a44f809bc32664':
hvcc: zero initialize the nal buffers past the last written byte
This commit is a noop, see 9482ec1b20
Merged-by: Mark Thompson <sw@jkqxz.net>
The commit which added those was pushed prematurely before anyone could object
to illogical suffixes like just m for milliseconds. Without this, we'd be locked
into never being able to implement the "m" suffix for minutes.
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
Right now, if someone configures ffmpeg with for example --enable-nvenc they will
get an error message complaining about missing cuda.
This is very confusing and already has lead people into installing the CUDA SDK,
even though it's not what they need.
This will make it complain about ffnvcodec instead.
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
This saves one malloc + memcpy per packet
The CodedBitstreamFragment buffer is padded to follow the requirements
of AVPacket.
Reviewed-by: jkqxz
Signed-off-by: James Almer <jamrial@gmail.com>
Currently it always shows "Selected ratecontrol mode is not supported
by the QSV runtime. Choose a different mode", but sometimes it is not
accurate.
Signed-off-by: Zhong Li <zhong.li@intel.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
mov_read_ctts ignores ctts entries having count <= 0. Generally, the
aggregate of all ctts entries' count fields resulting from mov_read_ctts
can be less than the corresponding sample_count.
mov_build_index attempts to normalize any existing ctts_data counts to
be 1, to make a 1-1 mapping of a ctts_data entry to a sample.
That 1-1 mapping left a tail of uninitialized ctts_data entries when the
aggregate, normalized ctts_count < sample_count.
Even more generally, later usage of ctts_data may depend on the entire
ctts_allocated_size having been initialized.
This change memsets the entire allocation of the normalized ctts_data in
mov_build_index, to prevent use of uninitialized data later.
BUG=816787
Change-Id: I7fd7db255e3aeed076ee32c90cb2df211741c052
Reviewed-on: https://chromium-review.googlesource.com/947110
Reviewed-by: Xiaohan Wang <xhwang@chromium.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Due to the union construct, unused bits in bitplane_present.value might
be uninitialized even when the used bits are all set to a value.
Masking the unused bits prevents spurious true values when all used
bits are unset, e.g. skipped pictures.
Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
Pass necessary bitstream elements to the VAAPI VC-1 decoder in order
to start doing interlaced decoding in hardware.
Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
We need to pass more bitstream elements to the VAAPI VC-1 decoder in
order to start doing interlaced decoding in hardware.
Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
Update dump_extra bit stream filter docs to follow current
code implement.
Signed-off-by: Jun Zhao <jun.zhao@intel.com>
Reviewed-by: Steven Liu <lq@onvideo.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
nvenc doesn't support P016, but we have two problems today:
1) We declare support for YUV444P16 which nvenc also doesn't support.
We do this because it's the only pix_fmt we have that can
approximate nvenc's internal format that is YUV444P10 with data in
MSBs instead of LSBs. Because the declared format is a 16bit one,
it will be preferrentially chosen when encoding >10bit content,
but that content will normally be YUV420P12 or P016 which should
get mapped to P010 and not YUV444P10.
2) Transcoding P016 content with nvenc should be possible in a pure
hardware pipeline, and that can't be done if nvenc doesn't say it
accepts P016. By mapping it to P010, we can use it, albeit with
truncation. I have established that swscale doesn't know how to
dither to 10bits so we'd get truncation anyway, even if we tried
to do this 'properly'.
To make the best use of existing code, I generalised the wrapper
that currently does yuv420p10 to p010 to support any mixture of
input and output sizes between 10 and 16 bits. This had the side
effect of yielding a working code path for all yuv420p1x formats
to p01x.
fix ticket: #7044
Get the first video stream to reference for split segment
when there have more than one video stream
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
Reviewed-by: Karthick Jeyapal <kjeyapal@akamai.com>
The allocated size of sc->ctts_data is
(st->nb_index_entries + entries) * sizeof(*sc->ctts_data).
The size to memset at offset sc->ctts_data + sc->ctts_count should be
(st->nb_index_entries + entries - sc->ctts_count) *
sizeof(*sc->ctts_data))
The current code missed |entries| I believe, which was introduced in
https://patchwork.ffmpeg.org/patch/5541/.
However, after offline discussion, it seems the original code is much
more clear to read (before https://patchwork.ffmpeg.org/patch/5541/).
Hence this CL revert the memset logic to it's previous state by
remembering the |old_ctts_allocated_size|, and only memset the newly
allocated entries.
BUG=812567
Change-Id: Ibe94c7138e5818bfaae76866bfa6619a9b8a2b6b
Reviewed-on: https://chromium-review.googlesource.com/934925
Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Obviously this is still not perfect, but better then it was. Using the first
index table and mxf->current_edit_unit is still hardcoded in many places, so
this change has hopefully the less chance of breaking anything that works
now.
Signed-off-by: Marton Balint <cus@passwd.hu>