ffmpeg.git
4 years agoconfigure: loongson disable expensive optimizations in gcc O3 optimization
周晓勇 [Wed, 15 Jul 2015 09:28:31 +0000 (17:28 +0800)]
configure: loongson disable expensive optimizations in gcc O3 optimization

With gcc-4.9.2 loongson faild in test fate-dca, this is caused by option
-fexpensive-optimizations in -O3 optimization. We disable it temporarily
before the bug been fixed up.

Signed-off-by: ZhouXiaoyong <zhouxiaoyong@loongson.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 2c34389551b6ba3d90f8783806c337e387e603cd)

Conflicts:

configure

4 years agovideodsp: don't overread edges in vfix3 emu_edge.
Ronald S. Bultje [Fri, 23 Oct 2015 15:11:53 +0000 (11:11 -0400)]
videodsp: don't overread edges in vfix3 emu_edge.

Fixes trac ticket 3226. Also see Andreas' analysis in
https://bugs.debian.org/801745, which was very helpful.
(cherry picked from commit 52f84d82bdf1851ecfcc412c1719e5f6f3396209)

4 years agoavformat/mp3dec: improve junk skipping heuristic
wm4 [Tue, 20 Oct 2015 10:17:21 +0000 (12:17 +0200)]
avformat/mp3dec: improve junk skipping heuristic

Commit 2b3e9bbfb529e6bde238aeb511b55ebe461664c8 caused problems for a
certain API user:

https://code.google.com/p/chromium/issues/detail?id=537725
https://code.google.com/p/chromium/issues/detail?id=542032

The problem seems rather arbitrary, because if there's junk, anything
can happen. In this case, the imperfect junk skipping just caused it to
read different junk, from what I can see.

We can improve the accuracy of junk detection by a lot by checking if 2
consecutive frames use the same configuration. While in theory it might
be completely fine for the 1st frame to have a different format than the
2nd frame, it's exceedingly unlikely, and I can't think of a legitimate
use-case.

This is approximately the same mpg123 does for junk skipping. The
set of compared header bits is the same as the libavcodec mp3 parser
uses for similar purposes.
(cherry picked from commit de1b1a7da9e6ddf42447271e519099a88b389e4a)

Conflicts:
libavformat/mp3dec.c

4 years agoavformat/hls: add support for EXT-X-MAP
Anssi Hannula [Thu, 15 Oct 2015 11:23:00 +0000 (14:23 +0300)]
avformat/hls: add support for EXT-X-MAP

Without EXT-X-MAP support we miss the first bytes of some streams.

These streams worked by luck before byte-ranged segment support was added in
da7759b3579de3e98deb1ac58e642b861280ba54

Fixes ticket #4797.
(cherry picked from commit 909907948846dedf57a730a4d115d04d1117f9e5)

Conflicts:
libavformat/hls.c

4 years agoavformat/hls: fix segment selection regression on track changes of live streams
Anssi Hannula [Thu, 15 Oct 2015 10:42:38 +0000 (13:42 +0300)]
avformat/hls: fix segment selection regression on track changes of live streams

Commit ad701326b43078b90 ("avformat/hls: open playlists immediately when
AVDISCARD_ALL is dropped") inadvertently caused first_packet to never be
cleared, causing select_cur_seq_no() to not use the specific code for
live streams.

In practice this means that when the user selects a different audio
track during live stream (i.e. non-VOD) playback, there may be some
additional delay as the code might select an incorrect segment at first,
and we have to wait for video to catch audio (if too late segment was
selected) or to download more following audio segments (if too early
segment was selected).

Fix that by restoring the zeroing of first_packet.
(cherry picked from commit fd74d45d5158812675105a3b4aeb29c67b82f7e8)

4 years agolavf/matroskadec: Fully parse and repack MP3 packets
Rodger Combs [Sun, 16 Aug 2015 08:06:04 +0000 (03:06 -0500)]
lavf/matroskadec: Fully parse and repack MP3 packets

Fixes https://trac.ffmpeg.org/ticket/4776

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit b4b2717ffe89940999eeca7317190f729b27f472)

4 years agoavcodec/h264_mp4toannexb_bsf: Reorder operations in nal_size check
Michael Niedermayer [Fri, 21 Aug 2015 00:49:21 +0000 (02:49 +0200)]
avcodec/h264_mp4toannexb_bsf: Reorder operations in nal_size check

Fixes Ticket4778

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 2bb54b82b5094fd906aa28c0443be08c95662a31)

4 years agoavformat/oggenc: Check segments_count for headers too
Michael Niedermayer [Thu, 27 Aug 2015 02:08:42 +0000 (04:08 +0200)]
avformat/oggenc: Check segments_count for headers too

Fixes infinite loop and segfault in ogg_buffer_data()
Fixes Ticket4806

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 81a8701eb52d2b6469ae16ef442ce425388141b7)

4 years agoavformat/segment: atomically update list if possible
Michael Niedermayer [Thu, 27 Aug 2015 21:40:25 +0000 (23:40 +0200)]
avformat/segment: atomically update list if possible

Fixes Ticket4802

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit e2b19a533dbb4cb0fba85261ea835316381bc907)

4 years agoavformat/avidec: Workaround broken initial frame
Michael Niedermayer [Tue, 15 Sep 2015 02:01:27 +0000 (04:01 +0200)]
avformat/avidec: Workaround broken initial frame

Fixes Ticket4851

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 3e2ef00394b8079e93835d47c993868229f07502)

4 years agohevc: properly handle no_rasl_output_flag when removing pictures from the DPB
Hendrik Leppkes [Sat, 12 Sep 2015 19:50:24 +0000 (21:50 +0200)]
hevc: properly handle no_rasl_output_flag when removing pictures from the DPB

Fixes ticket #4185.

Reviewed-By: Mickael Raulet <Mickael.Raulet@insa-rennes.fr>
Signed-off-by: Hendrik Leppkes <h.leppkes@gmail.com>
(cherry picked from commit 0118158efa8e45761f9f65a3bb74f33907bd2aec)

4 years agohevc: fix wpp threading deadlock.
Ronald S. Bultje [Sun, 20 Sep 2015 10:39:14 +0000 (12:39 +0200)]
hevc: fix wpp threading deadlock.

Fixes ticket 4258.
(cherry picked from commit 74e4948235bc8f8946eeca20525258bbf383f75d)

4 years agoavcodec/ffv1: seperate slice_count from max_slice_count
Michael Niedermayer [Thu, 24 Sep 2015 21:49:30 +0000 (23:49 +0200)]
avcodec/ffv1: seperate slice_count from max_slice_count

Fix segfault with too large slice_count
Fixes Ticket4879

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit aa6c43f3fdec8a7518534b9dab20c9eb4be11568)

Conflicts:
libavcodec/ffv1enc.c

4 years agolavf/img2dec: Fix memory leak
Przemysław Sobala [Tue, 29 Sep 2015 13:25:07 +0000 (15:25 +0200)]
lavf/img2dec: Fix memory leak

Fixes #4886

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 01dd7e025c246d9001f1a30f4a5d8fa2936d1a5e)

4 years agoavcodec/mp3: fix skipping zeros
wm4 [Wed, 30 Sep 2015 12:53:35 +0000 (14:53 +0200)]
avcodec/mp3: fix skipping zeros

Commits 43bc5cf9 and c5371f77 add code for skipping initial zeros in mp3
packets. This code forgot to report to the user that data was skipped at
all.

Since audio codecs allow partial packet decoding, the user application
has to rely on the return value. It will remove the data reported as
consumed by the decoder, and feed it to the decoder again. This resulted
in the mp3 frame after the zero region to be decoded over and over
again, until the zero region was finally skipped by the application.

Fix this by including the amount of skipped bytes to the number of
consumed bytes returned by the decode call.

Fixes trac ticket #4890.
(cherry picked from commit cb1da9fb8d71bb611a7b0028914c97afc3f5711d)

4 years agoavformat/srtdec: make sure we probe a number
Clément Bœsch [Fri, 9 Oct 2015 08:52:58 +0000 (10:52 +0200)]
avformat/srtdec: make sure we probe a number

Fixes regression since 7218352e0228028dfa009a3799ec93fd041065f1: WebVTT
files were matching the SRT probing.
(cherry picked from commit 40d9d6de90c3652f4c468ab14976c7faf5e40c07)

4 years agoavformat/srtdec: more lenient first line probing
Clément Bœsch [Thu, 1 Oct 2015 09:48:45 +0000 (11:48 +0200)]
avformat/srtdec: more lenient first line probing

Fixes Ticket #4898
(cherry picked from commit 7218352e0228028dfa009a3799ec93fd041065f1)

4 years agodoc: mention libavcodec can decode Opus natively
James Almer [Mon, 21 Sep 2015 02:20:43 +0000 (23:20 -0300)]
doc: mention libavcodec can decode Opus natively

Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit fd9ac48dc8aebcbd601af34336234d5102b36e21)

4 years agoavcodec/ffv1enc: fix assertion failure with unset bits per raw sample
Michael Niedermayer [Mon, 20 Jul 2015 00:10:04 +0000 (02:10 +0200)]
avcodec/ffv1enc: fix assertion failure with unset bits per raw sample

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 749f85496ccff345ec811976ce45ec9e1900e9a8)

Fixes ticket #4751.

4 years agoMAINTAINERS: Remove myself as leader
Michael Niedermayer [Fri, 31 Jul 2015 13:54:38 +0000 (15:54 +0200)]
MAINTAINERS: Remove myself as leader

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit f2c58931e629343f7d68258cc2b2d62c5f501ba5)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agomips/hevcdsp: fix string concatenation on macros
James Almer [Thu, 30 Jul 2015 22:28:02 +0000 (19:28 -0300)]
mips/hevcdsp: fix string concatenation on macros

Needed for old compilers like GCC 4.2

Tested by trac user brad. Fixes ticket #4745

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit a0092cea462ff4f203aaff09c42c6731c6516b44)

4 years agoChangelog update n2.7.2
Andreas Cadhalpun [Fri, 10 Jul 2015 17:41:43 +0000 (19:41 +0200)]
Changelog update

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
4 years agoimc: use correct position for flcoeffs2 calculation
Andreas Cadhalpun [Fri, 10 Jul 2015 19:50:50 +0000 (21:50 +0200)]
imc: use correct position for flcoeffs2 calculation

flcoeffs2[pos] should be the log2 of flcoeffs1[pos].
flcoeffs1[0] can be 0 here, thus flcoeffs2[pos] gets set to -inf,
causing problems further down.

This seems to have been copied from imc_decode_level_coefficients in
commit 4eb4bb3 without updating the position.

Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 75fd5ce4c1c0b2d96d71c74b650cefaaef519d27)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
4 years agohevc: check slice address length
Andreas Cadhalpun [Fri, 10 Jul 2015 17:41:43 +0000 (19:41 +0200)]
hevc: check slice address length

It is used as get_bits argument and reading 0 bits isn't supported.

Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 05cc8c8e4b7008ff3be8ec477c901b2ceca4b16b)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
4 years agosnow: remove an obsolete av_assert2
Andreas Cadhalpun [Thu, 9 Jul 2015 17:50:34 +0000 (19:50 +0200)]
snow: remove an obsolete av_assert2

It asserts that the frame linesize is larger than 37, but it can be
smaller and decoding such frames works.

Before commit cc884a35 src_stride > 7*MB_SIZE was necessary, because the
blocks were interleaved in the tmp buffer and the last block was added
with an offset of 6*MB_SIZE.
It was changed for src_stride <= 7*MB_SIZE to write the blocks
sequentially, hence the larger tmp_step.
After that the assert was only necessary to make sure that the buffer
remained large enough.
Since commit bd2b6b33 s->scratchbuf is used as tmp buffer.
As part of commit 86e107a7 the minimal scratchbuf size was increased to
256*7*MB_SIZE, which is enough for any src_stride <= 7*MB_SIZE.

Also add a comment explaining the tmp_step calculation.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 3526a120f92929cb0a4009e403ee2f141030c487)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
4 years agowebp: fix infinite loop in webp_decode_frame
Andreas Cadhalpun [Thu, 2 Jul 2015 21:45:46 +0000 (23:45 +0200)]
webp: fix infinite loop in webp_decode_frame

The loop always needs at least 8 bytes for chunk_type and chunk_size.
If fewer are left, bytestream2_get_le32 just returns 0 without
reading any bytes, leading to an infinite loop.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0762152f7af6cd93bc8f504d5503723500c3f369)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
4 years agowavpack: limit extra_bits to 32 and use get_bits_long
Andreas Cadhalpun [Thu, 2 Jul 2015 21:05:05 +0000 (23:05 +0200)]
wavpack: limit extra_bits to 32 and use get_bits_long

More than 32 bits can't be stored in an integer and get_bits should not
be used with more than 25 bits.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit d0eff8857ceff2601f85037c930cbe61a88b611e)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
4 years agoffmpeg: only count got_output/errors in decode_error_stat
Andreas Cadhalpun [Tue, 30 Jun 2015 19:09:50 +0000 (21:09 +0200)]
ffmpeg: only count got_output/errors in decode_error_stat

If threading is used, the first (thread_count - 1) packets are read
before any frame/error is returned. Counting this as successful decoding
is wrong, because it also happens when no single frame could be decoded.

Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit bd0f14123fd8c7ff1c27b726d143f84c67f3a522)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
4 years agoffmpeg: exit_on_error if decoding a packet failed
Andreas Cadhalpun [Tue, 30 Jun 2015 19:06:40 +0000 (21:06 +0200)]
ffmpeg: exit_on_error if decoding a packet failed

This is the second part of the fix for ticket #4370.

Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit cd64ead8d96b2d2c300e0ac620fb82b17d6051bf)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Conflicts:
ffmpeg.c

4 years agopthread_frame: forward error codes when flushing
Andreas Cadhalpun [Tue, 30 Jun 2015 19:01:29 +0000 (21:01 +0200)]
pthread_frame: forward error codes when flushing

This is the first part of the fix for ticket #4370.

Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 32a5b631267e1f8bf279e407039b9a99d012d033)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
4 years agohuffyuvdec: validate image size
Andreas Cadhalpun [Sun, 28 Jun 2015 09:21:54 +0000 (11:21 +0200)]
huffyuvdec: validate image size

Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 9a345802edf7f430b3335f486aecdd8552f8367b)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
4 years agowavpack: use get_bits_long to read up to 32 bits
Andreas Cadhalpun [Sat, 27 Jun 2015 18:16:12 +0000 (20:16 +0200)]
wavpack: use get_bits_long to read up to 32 bits

get_bits should not be used for more than 25 bits.

Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit f9883a669c3df05a5c453428e080298c6511a17e)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
4 years agonutdec: check maxpos in read_sm_data before returning success
Andreas Cadhalpun [Sat, 27 Jun 2015 15:50:56 +0000 (17:50 +0200)]
nutdec: check maxpos in read_sm_data before returning success

Otherwise sm_size can be larger than size, which results in a negative
packet size.

Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 6b9fdf7f4f07926557048070cc2af3cfd0e3fe50)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
4 years agos302m: fix arithmetic exception
Andreas Cadhalpun [Fri, 26 Jun 2015 17:31:03 +0000 (19:31 +0200)]
s302m: fix arithmetic exception

If nb_samples is zero, the bit_rate calculation results in a division by
zero.

Since ff_get_buffer fails if frame->nb_samples is zero, this can be
fixed by moving the bit_rate calculation after that function call.

That also makes it possible to reuse the already calculated
frame->nb_samples value.

Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 04dfbc9441beed93984568c1547f1ed588122627)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
4 years agovc1dec: use get_bits_long and limit the read bits to 32
Andreas Cadhalpun [Thu, 25 Jun 2015 20:47:38 +0000 (22:47 +0200)]
vc1dec: use get_bits_long and limit the read bits to 32

get_bits should not be used with more than 25 bits.

Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 1f1e0a2971b2a01f275bb5088c2e36166514be64)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
4 years agompegaudiodec: copy AVFloatDSPContext from first context to all contexts
Andreas Cadhalpun [Thu, 25 Jun 2015 22:27:54 +0000 (00:27 +0200)]
mpegaudiodec: copy AVFloatDSPContext from first context to all contexts

This fixes a segfault when decoding multi-channel MP3onMP4 files.

This is similar to commit cb72230d for MPADSPContext.

Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 151dbe4579601a81662b4b366d0e10df3c00027a)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
4 years agoUpdate for FFmpeg 2.7.2
Michael Niedermayer [Sat, 18 Jul 2015 18:53:40 +0000 (20:53 +0200)]
Update for FFmpeg 2.7.2

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/vp8: Check buffer size in vp8_decode_frame_header()
Michael Niedermayer [Sat, 18 Jul 2015 17:18:24 +0000 (19:18 +0200)]
avcodec/vp8: Check buffer size in vp8_decode_frame_header()

avoids null pointer dereference
Fixes: signal_sigsegv_d5de40_964_vp80-00-comprehensive-010.ivf with memlimit of 1048576

Found-by: Samuel Groß, Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 599d746e07319dc792ed2e511b666fe482f1ff88)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/vp8: Fix null pointer dereference in ff_vp8_decode_free()
Michael Niedermayer [Sat, 18 Jul 2015 17:02:26 +0000 (19:02 +0200)]
avcodec/vp8: Fix null pointer dereference in ff_vp8_decode_free()

Fixes: signal_sigsegv_d5de23_967_vp80_00_comprehensive_010.ivf with memlimit 524288

Found-by: Samuel Groß, Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit a84f0e8d8f293df3c535f9b893730a835bed6520)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/diracdec: Check for hpel_base allocation failure
Michael Niedermayer [Sat, 18 Jul 2015 15:55:19 +0000 (17:55 +0200)]
avcodec/diracdec: Check for hpel_base allocation failure

Fixes null pointer dereference
Fixes: signal_sigsegv_b02a96_280_RL_420p_ffdirac.drc with memlimit of 67108864

Found-by: Samuel Groß, Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 1c5b712c0a643a039d6f34269b4102de313a050a)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/rv34: Clear pointers in ff_rv34_decode_init_thread_copy()
Michael Niedermayer [Sat, 18 Jul 2015 09:24:45 +0000 (11:24 +0200)]
avcodec/rv34: Clear pointers in ff_rv34_decode_init_thread_copy()

Avoids leaving stale pointers
Fixes: signal_sigabrt_7ffff70eccc9_819_sabtriple.rm with memlimit 536870912

Found-by: Samuel Groß, Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 3197c0aa87a3b7190e17d49e6fbc7b554e4b3f0a)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavfilter/af_aresample: Check ff_all_* for allocation failures
Michael Niedermayer [Fri, 17 Jul 2015 18:27:25 +0000 (20:27 +0200)]
avfilter/af_aresample: Check ff_all_* for allocation failures

Fixes: signal_sigabrt_7ffff70eccc9_498_divx502.avi with memlimit 1572864

Found-by: Samuel Groß, Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 2ea8a480832acad3095783bcb11d5f290bec56cf)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/pthread_frame: clear priv_data, avoid stale pointer in error case
Michael Niedermayer [Thu, 16 Jul 2015 09:52:33 +0000 (11:52 +0200)]
avcodec/pthread_frame: clear priv_data, avoid stale pointer in error case

Fixes: b4b47bc2b3fb7ca710bfffe5aa969e37_signal_sigabrt_7ffff70eccc9_744_nc_sample2.avi with memlimit of 4194304

Found-by: Samuel Groß, Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit f1a38264f20382731cf2cc75fdd98f4c9a84a626)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoswscale/utils: Clear pix buffers
Michael Niedermayer [Wed, 15 Jul 2015 17:20:19 +0000 (19:20 +0200)]
swscale/utils: Clear pix buffers

Fixes use of uninitialized memory
Fixes: a96874b9466b6edc660a519c7ad47977_signal_sigsegv_7ffff713351a_744_nc_sample.avi with memlimit 2147483648

Found-by: Samuel Groß, Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit a5d44d5c220e12ca0cb7a4eceb0f74759cb13111)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavutil/fifo: Fix the case where func() returns less bytes than requested in av_fifo_g...
Zhang Rui [Tue, 14 Jul 2015 06:47:26 +0000 (14:47 +0800)]
avutil/fifo: Fix the case where func() returns less bytes than requested in av_fifo_generic_write()

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit fcbea93cf8777bbef2a393d26942b5d3c70a448d)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoffmpeg: Fix cleanup after failed allocation of output_files
Michael Niedermayer [Tue, 14 Jul 2015 13:49:41 +0000 (15:49 +0200)]
ffmpeg: Fix cleanup after failed allocation of output_files

Fixes: 39a25908b84604acdaa490138282d091_signal_sigsegv_7ffff713351a_331_WAWV.avi with memlimit of 262144

Found-by: Samuel Groß, Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 6e80fe1ecd984a59bb6c73cbb436cc06536b7728)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/mov: Fix deallocation when MOVStreamContext failed to allocate
Michael Niedermayer [Tue, 14 Jul 2015 12:14:16 +0000 (14:14 +0200)]
avformat/mov: Fix deallocation when MOVStreamContext failed to allocate

Fixes: 260813283176b57b3c9974fe284eebc3_signal_sigsegv_7ffff713351a_991_xtrem_e2_m64q15_a32sxx.3gp with memlimit of 262144

Found-by: Samuel Groß, Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 15629129dde771446a005282ee33c4ea1199e696)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoffmpeg: Fix crash with ost->last_frame allocation failure
Michael Niedermayer [Tue, 14 Jul 2015 11:02:19 +0000 (13:02 +0200)]
ffmpeg: Fix crash with ost->last_frame allocation failure

Fixes: 1013dbde2c360d939cc2dfc33e4f275c_signal_sigsegv_a0500f_45_320vp3.nsv with memlimit of 536870912

Found-by: Samuel Groß, Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit fd4c87fa3becaf8a6c480db915daf51e297b76c5)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoffmpeg: Fix cleanup with ost = NULL
Michael Niedermayer [Mon, 13 Jul 2015 21:33:18 +0000 (23:33 +0200)]
ffmpeg: Fix cleanup with ost = NULL

Fixes: 09e670595acbdafb226974b08dab66e3_signal_sigabrt_7ffff70eccc9_991_xtrem_e2_m64q15_a32sxx.3gp with memlimit of 1048576

Found-by: Samuel Groß, Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 503ec7139f887bf8ed8d57da07ce93c4e88447a6)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/pthread_frame: check avctx on deallocation
Michael Niedermayer [Mon, 13 Jul 2015 19:19:04 +0000 (21:19 +0200)]
avcodec/pthread_frame: check avctx on deallocation

Fixes null pointer dereferences
Fixes: af1a5a33e67e479f439239097bd0d4fd_signal_sigsegv_7ffff713351a_152_Dolby_Rain_Logo.pmp with memlimit of 8388608

Found-by: Samuel Groß, Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 5d346feafa817c4fbc30f7ed0b93b2dad6cef15b)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/sanm: Reset sizes in destroy_buffers()
Michael Niedermayer [Mon, 13 Jul 2015 14:05:21 +0000 (16:05 +0200)]
avcodec/sanm: Reset sizes in destroy_buffers()

Fixes crash in 1288a2fe8e9ae6b00ca40e089d08ca65_signal_sigsegv_7ffff71426a7_354_accident.san with allocation limit 65536

Found-by: Samuel Groß, Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 39bbdebb1ed8eb9c9b0cd6db85afde6ba89d86e4)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/alac: Clear pointers in allocate_buffers()
Michael Niedermayer [Mon, 13 Jul 2015 13:46:10 +0000 (15:46 +0200)]
avcodec/alac: Clear pointers in allocate_buffers()

Fixes: 06a4edb39ad8a9883175f9bd428334a2_signal_sigsegv_7ffff713351a_706_mov__alac__ALAC_6ch.mov

Found-by: Samuel Groß, Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit f7068bf277a37479aecde2832208d820682b35e6)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agobytestream2: set the reader to the end when reading more than available
Anton Khirnov [Fri, 10 Jul 2015 07:31:24 +0000 (09:31 +0200)]
bytestream2: set the reader to the end when reading more than available

This prevents possible infinite loops with the calling code along the
lines of while (bytestream2_get_bytes_left()) { ... }, where the reader
does not advance.

CC: libav-stable@libav.org
(cherry picked from commit 86eee85daddb682fa072c2e2657c90a514b855e3)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/utils: use a minimum 32pixel width in avcodec_align_dimensions2() for H.264
Michael Niedermayer [Fri, 10 Jul 2015 00:01:17 +0000 (02:01 +0200)]
avcodec/utils: use a minimum 32pixel width in  avcodec_align_dimensions2() for H.264

Fixes Assertion failure
Found-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 7ef6656b1e5bfbc7499013d3b38b093b6b2f31ec)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/mpegvideo: Clear pointers in ff_mpv_common_init()
Michael Niedermayer [Thu, 9 Jul 2015 20:16:15 +0000 (22:16 +0200)]
avcodec/mpegvideo: Clear pointers in ff_mpv_common_init()

This ensures that no stale pointers leak through on any path

Fixes: signal_sigsegv_c3097a_991_xtrem_e2_m64q15_a32sxx.3gp

Found-by: Samuel Groß, Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b160fc290cf49b516c5b6ee0730fd9da7fc623b1)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
4 years agooggparsedirac: check return value of init_get_bits
Chris Watkins [Tue, 7 Jul 2015 17:23:44 +0000 (10:23 -0700)]
oggparsedirac: check return value of init_get_bits

If init_get_bits fails the GetBitContext is invalid and must not be
used. Check the return value in dirac_header and propogate the error.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4f5c2e651a95b950f6a3fb36f2342cbc32515f17)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
4 years agowmalosslessdec: reset frame->nb_samples on packet loss
Andreas Cadhalpun [Thu, 2 Jul 2015 22:02:44 +0000 (00:02 +0200)]
wmalosslessdec: reset frame->nb_samples on packet loss

Otherwise a frame with non-zero nb_samples but without any data can be
returned.

Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 42e7a5b3c704985c2c18970cc94a837b413df9d9)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
4 years agowmalosslessdec: avoid reading 0 bits with get_bits
Andreas Cadhalpun [Thu, 2 Jul 2015 22:01:56 +0000 (00:01 +0200)]
wmalosslessdec: avoid reading 0 bits with get_bits

Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit f9020d514e9ed5043496a710b36daba1ab182e97)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
4 years agoPut a space between string literals and macros.
Chris Watkins [Tue, 7 Jul 2015 17:40:27 +0000 (10:40 -0700)]
Put a space between string literals and macros.

When compiling libavutil/internal.h as C++11, clang warns that a space
is required between a string literal and an identifier. Put spaces
in concatenations of string literals and EXTERN_PREFIX.

Signed-off-by: Chris Watkins <watk@chromium.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 55e29ceec84aa498122576c1ae8a0fa1fab0b41e)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
4 years agoavcodec/rawenc: Use ff_alloc_packet() instead of ff_alloc_packet2()
Michael Niedermayer [Sun, 5 Jul 2015 18:00:15 +0000 (20:00 +0200)]
avcodec/rawenc: Use ff_alloc_packet() instead of ff_alloc_packet2()

the later is not optimal when the buffer size is well known at allocation time

This avoids a memcpy()
Overall 2.5% speedup with a random 1920x1080 video

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 47496eb97cff8130991313d1b7292613620d8592)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
4 years agoavcodec/aacsbr: Assert that bs_num_env is positive
Michael Niedermayer [Wed, 1 Jul 2015 00:08:25 +0000 (02:08 +0200)]
avcodec/aacsbr: Assert that bs_num_env is positive

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 2e13a45b1a9a69456631e582bbb06954d169eb55)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
4 years agoavcodec/aacsbr: check that the element type matches before applying SBR
Michael Niedermayer [Wed, 1 Jul 2015 00:05:43 +0000 (02:05 +0200)]
avcodec/aacsbr: check that the element type matches before applying SBR

Fixes out of array access
Fixes: signal_sigsegv_3670fc0_2818_cov_2307326154_moon.mux

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 79a98294da6cd85f8c86b34764c5e0c43b09eea3)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
4 years agoavcodec/h264_slice: Use w/h from the AVFrame instead of mb_w/h
Michael Niedermayer [Tue, 30 Jun 2015 17:37:12 +0000 (19:37 +0200)]
avcodec/h264_slice: Use w/h from the AVFrame instead of mb_w/h

Fixes out of array access
Fixes: asan_heap-oob_4d5bb0_682_cov_3124593265_Fraunhofer__a_driving_force_in_innovation__small.mp4

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 330863c9f19a23c500ba7901a23f1cc377b353bb)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
4 years agovp9/update_prob: prevent out of bounds table read
James Zern [Tue, 30 Jun 2015 06:03:14 +0000 (23:03 -0700)]
vp9/update_prob: prevent out of bounds table read

the max value of the lookup in expanded form is:
(((1 << 7) - 1) << 1) - 65 + 1 + 64 = 254

add one entry of padding to inv_map_table[] to prevent out of bounds
access with non-conforming / fuzzed bitstreams

Signed-off-by: James Zern <jzern@google.com>
Reviewed-by: "Ronald S. Bultje" <rsbultje@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e91f860ea74e11e9178500fe8794c47f57dbf48c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
4 years agoavfilter/vf_transpose: Fix rounding error
Michael Niedermayer [Tue, 30 Jun 2015 14:01:15 +0000 (16:01 +0200)]
avfilter/vf_transpose: Fix rounding error

Fixes out of array access
Fixes: asan_heap-oob_7f875d_3482_cov_1818465256_ssudec.mov

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0083c16605aa5997534e87e68f97ef85a8c3b7b8)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
4 years agoavcodec/h264_refs: discard mismatching references
Michael Niedermayer [Tue, 30 Jun 2015 01:23:30 +0000 (03:23 +0200)]
avcodec/h264_refs: discard mismatching references

Fixes inconsistency and out of array access
Fixes: asan_heap-oob_17301a3_2100_cov_3226131691_ff_add_pixels_clamped_mmx.m2ts

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4aa0de644a2de62f0bc3013a4533ab9283aa0a65)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
4 years agoavcodec/mjpegdec: Fix small picture upscale
Michael Niedermayer [Mon, 29 Jun 2015 23:19:30 +0000 (01:19 +0200)]
avcodec/mjpegdec: Fix small picture upscale

Fixes out of array access

Fixes: asan_heap-oob_1dd60fd_267_cov_2954683513_5baad44ca4702949724234e35c5bb341.jpg

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 84afc6b70d24fc0bf686e43138c96cf60a9445fe)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
4 years agoavcodec/pngdec: Check values before updating context in decode_fctl_chunk()
Michael Niedermayer [Mon, 29 Jun 2015 20:32:02 +0000 (22:32 +0200)]
avcodec/pngdec: Check values before updating context in decode_fctl_chunk()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b54ac8403bfea4e7fab0799ccfe728ba76959a38)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
4 years agoavcodec/pngdec: Copy IHDR & plte state from last thread
Michael Niedermayer [Mon, 29 Jun 2015 19:59:41 +0000 (21:59 +0200)]
avcodec/pngdec: Copy IHDR & plte state from last thread

Previously these chunks where parsed again for each frame with threads
but not without leading to a different path and the potential for
inconsistencies

This also removes a related special case from decode_ihdr_chunk()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f1ffa01dd3dad983481bf05ec47246e7ec0c8932)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
4 years agoavcodec/pngdec: Require a IHDR chunk before fctl
Michael Niedermayer [Mon, 29 Jun 2015 19:57:12 +0000 (21:57 +0200)]
avcodec/pngdec: Require a IHDR chunk before fctl

This is required by the APNG spec

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a1736926e9ae51706b537776722e816a4d1f6b36)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
4 years agoavcodec/pngdec: Only allow one IHDR chunk
Michael Niedermayer [Mon, 29 Jun 2015 19:08:05 +0000 (21:08 +0200)]
avcodec/pngdec: Only allow one IHDR chunk

Multiple IHDR chunks are forbidden in PNG
Fixes inconsistency and out of array accesses

Fixes: asan_heap-oob_4d5c5a_1738_cov_2638287726_c-m2-8f2b481b7fd9bd745e620b7c01a18df2.png

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 47f4e2d8960ca756ca153ab8e3e93d80449b8c91)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
4 years agowmavoice: limit wmavoice_decode_packet return value to packet size
Andreas Cadhalpun [Sun, 28 Jun 2015 10:40:12 +0000 (12:40 +0200)]
wmavoice: limit wmavoice_decode_packet return value to packet size

Claiming to have decoded more bytes than the packet size is wrong.

Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 2a4700a4f03280fa8ba4fc0f8a9987bb550f0d1e)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
4 years agoswscale/swscale_unscaled: Fix rounding difference with RGBA output between little...
Michael Niedermayer [Mon, 29 Jun 2015 11:51:43 +0000 (13:51 +0200)]
swscale/swscale_unscaled: Fix rounding difference with RGBA output between little and big endian

Fixes fate/dds-rgb16 on big endian

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f6ab967eae497733f6adc12b30075980fd6eea98)

Conflicts:

tests/ref/fate/dds-rgb16

4 years agoffmpeg: Do not use the data/size of a bitstream filter after failure
Michael Niedermayer [Wed, 24 Jun 2015 11:27:39 +0000 (13:27 +0200)]
ffmpeg: Do not use the data/size of a bitstream filter after failure

Found-by: Rodger Combs
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8f0f678f090d9939b0014ba85641e2cb83d39cb8)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
4 years agoswscale/x86/rgb2rgb_template: fix signedness of v in shuffle_bytes_2103_{mmx,mmxext}
James Almer [Tue, 23 Jun 2015 04:15:07 +0000 (01:15 -0300)]
swscale/x86/rgb2rgb_template: fix signedness of v in shuffle_bytes_2103_{mmx,mmxext}

Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit e22edbfd413242dda720dc5191fc00a51c24d74c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
4 years agovda: unlock the pixel buffer base address.
Sebastien Zwickert [Sat, 20 Jun 2015 11:19:29 +0000 (13:19 +0200)]
vda: unlock the pixel buffer base address.

The pixel buffer base address is never unlocked this causes
a bug with some pixel format types that are produced natively
by the hardware decoder: the first buffer was always used.
Unlock the pixel buffer base address fixes the issue.
(cherry picked from commit c06fdacc3dc706e70d953917fea845532d3703ca)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
4 years agoswscale/rgb2rgb_template: Fix signedness of v in shuffle_bytes_2103_c()
Michael Niedermayer [Tue, 23 Jun 2015 03:09:11 +0000 (05:09 +0200)]
swscale/rgb2rgb_template: Fix signedness of v in shuffle_bytes_2103_c()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 7604358018229f345dfdf88b16c8930a67984435)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
4 years agoswscale/rgb2rgb_template: Implement shuffle_bytes_0321_c and fix shuffle_bytes_2103_c...
Michael Niedermayer [Tue, 23 Jun 2015 02:36:02 +0000 (04:36 +0200)]
swscale/rgb2rgb_template: Implement shuffle_bytes_0321_c and fix shuffle_bytes_2103_c on BE

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit abb833c5681b84d7025c083e2191140eaa30dca7)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
4 years agoswscale/rgb2rgb_template: Disable shuffle_bytes_2103_c on big endian
Michael Niedermayer [Mon, 22 Jun 2015 20:23:22 +0000 (22:23 +0200)]
swscale/rgb2rgb_template: Disable shuffle_bytes_2103_c on big endian

The function is specific to little endian

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4df3cf90bf7a54793e90304bd1b6c7599673f36a)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
4 years agoswr: Remember previously set int_sample_format from user
Michael Niedermayer [Mon, 22 Jun 2015 16:27:27 +0000 (18:27 +0200)]
swr: Remember previously set int_sample_format from user

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d4325b2fea9e2f4f4a17d0b929f12425e9c39964)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
4 years agoswresample: soxr implementation for swr_get_out_samples()
Rob Sykes [Sun, 21 Jun 2015 19:45:50 +0000 (19:45 +0000)]
swresample: soxr implementation for swr_get_out_samples()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c70c6be2259759b75c1b1dc7d68a0cf172f2cab8)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
4 years agoavformat/swfdec: Do not error out on pixel format changes
Michael Niedermayer [Wed, 8 Jul 2015 00:43:02 +0000 (02:43 +0200)]
avformat/swfdec: Do not error out on pixel format changes

Instead print an error and continue

Fixes Ticket4702

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6a1204a1a46674084b1e6b92562f81aaab7aac69)

4 years agoffmpeg_opt: Fix forcing fourccs
Michael Niedermayer [Wed, 1 Jul 2015 03:10:51 +0000 (05:10 +0200)]
ffmpeg_opt: Fix forcing fourccs

Fixes Ticket4682

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8750aef3d65c0d52946a9b52eba5f5203280b548)

4 years agoconfigure: Check for x265_api_get
Derek Buitenhuis [Fri, 26 Jun 2015 13:05:00 +0000 (14:05 +0100)]
configure: Check for x265_api_get

Any other x265 symbol may not exported, e.g. if the build is a
multilib (10-bit and 8-bit in one) build.

This is the only symbol we directly call, and is available in the
build number we check for.

Fixes the configure check on multilib x265 builds.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
(cherry picked from commit f4be604f1c4d5cb6480c81c671d646cc16b02017)

4 years agoswscale/x86/rgb2rgb_template: don't call emms on sse2/avx functions
James Almer [Tue, 23 Jun 2015 04:14:42 +0000 (01:14 -0300)]
swscale/x86/rgb2rgb_template: don't call emms on sse2/avx functions

Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 0c15f2f158e11950c2a5c831787ea377b7671bf4)

4 years agoswscale/x86/rgb2rgb_template: add missing xmm clobbers
James Almer [Tue, 23 Jun 2015 04:14:16 +0000 (01:14 -0300)]
swscale/x86/rgb2rgb_template: add missing xmm clobbers

Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 910eeab48026060b5f7780b2560445c069eb4d6b)

4 years agolibrary.mak: Workaround SDL redefining main and breaking fate tests on mingw
James Almer [Fri, 19 Jun 2015 10:11:16 +0000 (12:11 +0200)]
library.mak: Workaround SDL redefining main and breaking fate tests on mingw

Fixes Ticket3368

Commit message by commiter
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a9af9da6311b4ba50abe55d14d42a4d4818e83d8)

4 years agovaapi_h264: fix RefPicList[] field flags.
Gwenole Beauchesne [Tue, 23 Jun 2015 09:35:45 +0000 (11:35 +0200)]
vaapi_h264: fix RefPicList[] field flags.

Use new H264Ref.reference field to track field picture flags. The
H264Picture.reference flag in DPB is now irrelevant here.

This is a regression from git commit d8151a7, and that affected
multiple interlaced video streams.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
(cherry picked from commit 88325c2e0b63abf4c3482cecd43870015123764a)

4 years agodoc: avoid incorrect phrase 'allows to' n2.7.1
Andreas Cadhalpun [Sun, 14 Jun 2015 18:28:28 +0000 (20:28 +0200)]
doc: avoid incorrect phrase 'allows to'

Also fix typo found by Lou Logan:
Sacrifying -> Sacrificing

Reviewed-by: Lou Logan <lou@lrcd.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 28efeb6502df37c99ccf18575d2552381d83a877)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
4 years agoconfigure: make makeinfo_html check more robust
Andreas Cadhalpun [Sat, 13 Jun 2015 18:24:27 +0000 (20:24 +0200)]
configure: make makeinfo_html check more robust

The current check is too strict for newer makeinfo versions.
Existing version strings are:
makeinfo (GNU texinfo) 4.13
makeinfo (GNU texinfo) 5.2
texi2any (GNU texinfo) 5.9.93

Probably version 6 will come in the not too far future.

Reviewed-by: Timothy Gu <timothygu99@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 72654526e4489c0aac05d25cfeca5bbba26026b3)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
4 years agomatroskadec: validate audio channels and bitdepth
Andreas Cadhalpun [Mon, 15 Jun 2015 19:06:51 +0000 (21:06 +0200)]
matroskadec: validate audio channels and bitdepth

In the TTA extradata re-construction the values are written with
avio_wl16 and if they don't fit into uint16_t, this triggers an
av_assert2 in avio_w8.

Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 92e79a2f7bf2f8bb0cb2d1a3e4d76737557071c4)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
4 years agomatroskadec: check audio sample rate
Andreas Cadhalpun [Mon, 15 Jun 2015 18:59:22 +0000 (20:59 +0200)]
matroskadec: check audio sample rate

And default to 8000 if it is invalid.

An invalid sample rate can trigger av_assert2 in av_rescale_rnd.

Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 5b76c82fd7a5f4f36bb901b8c43d7f7319599599)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
4 years agoUpdate for 2.7.1
Michael Niedermayer [Fri, 19 Jun 2015 17:03:00 +0000 (19:03 +0200)]
Update for 2.7.1

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
4 years agoavcodec/dpxenc: implement write16/32 as functions
Michael Niedermayer [Fri, 19 Jun 2015 14:46:06 +0000 (16:46 +0200)]
avcodec/dpxenc: implement write16/32 as functions

Fixes undefined behavior and segfault

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8edc17b639c4ac47913c467107ffb43c67c64890)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
4 years agoavutil/avstring: Do not print NULL
Michael Niedermayer [Fri, 19 Jun 2015 13:57:32 +0000 (15:57 +0200)]
avutil/avstring: Do not print NULL

Fixes segfault
Fixes Ticket4452

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 52e02a9e59f83ede84363d0f035389e44357d4a5)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
4 years agopostproc: fix unaligned access
Andreas Cadhalpun [Thu, 18 Jun 2015 18:15:12 +0000 (20:15 +0200)]
postproc: fix unaligned access

QP_store is only 8-bit-aligned, so accessing it as uint32_t causes
SIGBUS crashes on sparc.
The AV_RN32/AV_WN32 macros only do unaligned access in the
HAVE_FAST_UNALIGNED case.

Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 590743101dc934043f34013f1c9bb9fb261355b0)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
4 years agovp9: don't retain NULL as segmentation_map
Andreas Cadhalpun [Wed, 17 Jun 2015 17:02:15 +0000 (19:02 +0200)]
vp9: don't retain NULL as segmentation_map

This fixes segmentation faults, which were introduced in commit
4ba8f327.

Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit d216b9debd9843d31732ebb7344a85b3cd96b7cc)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
4 years agoavformat: clarify what package needs to be compiled with SSL support
wm4 [Thu, 18 Jun 2015 18:36:19 +0000 (20:36 +0200)]
avformat: clarify what package needs to be compiled with SSL support

Try to reduce user confusion.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f6c3f1ed6048ebc55f652ed59f7af9acebbf57e5)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
4 years agoavcodec/libx264: Avoid reconfig on equivalent aspect ratios
Michael Niedermayer [Thu, 18 Jun 2015 12:40:11 +0000 (14:40 +0200)]
avcodec/libx264: Avoid reconfig on equivalent aspect ratios

Workaround for ticket #4287.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 7b1c03aa744f1f82fe30ea2cd2aeef2ea01d5ce9)

Conflicts:
libavcodec/libx264.c

4 years agoavcodec/flacenc: Fix Invalid Rice order
George Boyle [Tue, 16 Jun 2015 07:25:01 +0000 (08:25 +0100)]
avcodec/flacenc: Fix Invalid Rice order

Fixes ticket #4628.

The problem arose, in the sample file at least, in the last block where the
minimum and maximum Rice partition orders were both 0. In that case, and any
other where pmax == pmin, the original UINT32_MAX placeholder value for
bits[opt_porder] was getting overwritten before the comparison to check if the
current partition order is a new optimal, so the correct partition order and
RiceContext params were not being set.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 2469ed32c81ebf2347e6883091c566724b286167)