Related to CID1197063
The limit choosen is arbitrary and much larger than what makes sense.
It avoids the need for checking arithmetic operations with the length for overflow
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f9158b01d0)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
The check is possibly redundant, but better to check for errors
that dont occur than to skip the check and crash
Fixes CID1197060
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 754f84663e)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This change make error handling simplier.
av_opt_freep_ranges may be called when some ranges are NULL,
for example after memory allocation fail.
Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3aac5fcfa9)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* commit 'e0aa76d38a02090245284fc157afb9074e9ff073':
golomb: Fix the implementation of get_se_golomb_long
Merged-by: Michael Niedermayer <michaelni@gmx.at>
This was only used in hevc muxing code so far.
This makes the return values match what get_se_golomb returns for
the same bitstream reader instances.
The logic for producing a signed golomb code out of an unsigned one
was based on the corresponding code in get_se_golomb, which operated
directly on the bitstream reader buffer - not on the equivalent
return value from get_ue_golomb.
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 508a84e672)
Signed-off-by: Martin Storsjö <martin@martin.st>
The memory allocation for f->diffs was freed multiple times in some
corner cases. Simplify the code so that this doesn't happen.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 5b0ce5d4e3)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Fixes h264_mp4toannexb_bsf_failure.mkv
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 289b149cec)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
AV_CPU_FLAG_AVX is enabled at this point only if there's OS support.
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 2d9821a208)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Should fix fate failure with clang ftrapv
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c9c0451224)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Fixes build with --disable-everything
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 82a90e7764)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Fixes out of array accesses
This should not affect any release
Fixes: 8ab69af9e5a7a7e20fe04cdd25c0d6e7-asan_heap-oob_e72b82_5505_cov_2278389485_g2m4.wmv
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6b53c1aa82)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This reverts commit f65afef1df.
If only pts is coded then dts must be equal pts
See Rec. ITU-T H.222.0 (06/2012) / ISO/IEC 13818-1:2013 (E) 2.7.5
Found-by: Baptiste Coudurier
(cherry picked from commit 0bf882864e)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
this minimizes the amount of protocol seeks and reading needed in that case
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 171dd67520)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This reduces the number of protocol seeks
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 9600486d10)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This limits ABI issues in case libavcodec is linked to a libavutil with larger AVFrame
Which can happen if they are shiped in seperate binary packages and libavutil is upgraded
A cleaner alternative would be to replace them by pointers but this would likely cause
a small speedloss
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit fc567ac49e)
Conflicts:
libavcodec/h264.h
(cherry picked from commit 618d062bd553a7d7fad194d4236913f2b0a0251e)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This avoids a hypothetical integer overflow with very high resolution video
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e92a78a409)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This avoids a hypothetical integer overflow with very high resolution video
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c3272674c9)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This is unsafe and can deadlock amongth other things
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 9dca02ee54)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Makes no difference for any file tested but is needed
for following bug-fix
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 493296800c)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
0 should have been the default, this change should make no difference
but this is needed for the following bugfix
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 98f9aa389b)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>