Commit Graph

66488 Commits

Author SHA1 Message Date
Michael Niedermayer
991a203479 avcodec/utils: Check that the data is complete in avpriv_bprint_to_extradata()
Fixes out of array read
Fixes: asan_heap-oob_4d2250_814_cov_2745172097_JACOsub_capability_tester.jss
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3d5d95db3f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-30 21:40:36 +01:00
Michael Niedermayer
8524009161 avcodec/mjpegdec: Fix context fields becoming inconsistent
Fixes out of array access
Fixes: asan_heap-oob_1ca4f85_2760_cov_144449187_miss_congeniality_pegasus_ljpg.avi
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0eecf40935)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-30 21:40:36 +01:00
Michael Niedermayer
47f345de1d avcodec/mjpegdec: Check for pixfmtid 0x42111100 || 0x24111100 with more than 8 bits
These cases are not supported yet

Fixes assertion failure
Fixes: signal_sigabrt_7ffff6ac7bb9_1_cov_1553101927_00.jpg
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0bf416f262)

Conflicts:

	libavcodec/mjpegdec.c
2014-11-30 21:40:36 +01:00
Michael Niedermayer
af0a95ee03 swscale/x86/rgb2rgb_template: handle the first 2 lines with C in rgb24toyv12_*()
This avoids out of array accesses
Should fix Ticket3451

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-30 21:40:36 +01:00
Michael Niedermayer
2abc6e930b doc/APIchanges: Fix some wrong versions
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4eae568a07)

Conflicts:

	doc/APIchanges
2014-11-30 21:40:36 +01:00
Michael Niedermayer
3bb48296ef avformat/hlsenc: Free context after hls_append_segment
Fixes reading uninitialized memory

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

Conflicts:

	libavformat/hlsenc.c
2014-11-30 21:40:36 +01:00
Michael Niedermayer
a3fdc0b35b avcodec/mpeg4video_parser: fix spurious extradata parse warnings
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 7d37e45f6b)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-30 21:40:36 +01:00
Lukasz Marek
cf8b91a28e lavu/opt: fix av_opt_get function
Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
(cherry picked from commit 173d51c982)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-30 21:40:36 +01:00
Michael Niedermayer
cfda2a677c avcodec/wmaprodec: Fix integer overflow in sfb_offsets initialization
Fixes out of array read
Fixes: asan_heap-oob_2aec5b0_1828_classical_22_16_2_16000_v3c_0_exclusive_0_29.wma
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 5dcb99033d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-30 21:40:36 +01:00
Michael Niedermayer
11dfd1fa20 avcodec/utvideodec: fix assumtation that slice_height >= 1
Fixes out of array read
Fixes: asan_heap-oob_2573085_3783_utvideo_rgba_median.avi
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 7656c4c6e6)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-30 21:40:36 +01:00
Michael Niedermayer
f7e9fcda2d avcodec/options_table fix min of audio channels and sample rate
Found-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 206c98f303)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-30 21:40:36 +01:00
Carl Eugen Hoyos
2719ba9ee3 lavc/utils: Make pix_fmt desc pointer const.
Fixes an "initialization discards qualifiers from pointer target type" warning.
(cherry picked from commit f05855414e)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-30 21:40:36 +01:00
Dave Yeo
d48e0aed3c libavutil/threads.h: correct an include to be local
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 32eadfe453)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-29 12:07:17 +01:00
Dave Yeo
89b52d25b4 libavutil/thread.h: Support OS/2 threads
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 090a7801a8)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-29 12:07:17 +01:00
Michael Stypa
9984d492dc fix Makefile objects for pulseaudio support
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit cb58c771ad)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-28 21:31:26 +01:00
Michael Niedermayer
56b84b023d Merge commit 'ca78ee73db9e059f501706ba6108e23902e84933' into release/2.4
* commit 'ca78ee73db9e059f501706ba6108e23902e84933':
  opusdec: make sure all substreams have the same number of coded samples

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-28 01:19:28 +01:00
Michael Niedermayer
0e216ed407 avutil/buffer_internal: leave the buffer pool entries volatile
Theres no reason to remove the volatile keyword in a release branch

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-28 01:17:56 +01:00
Michael Niedermayer
f783259fdb avutil/buffer: use the old atomics based code for the release branch
the old code worked fine for a long time and was not affected by
the bug the new code fixes and the new is not widely tested yet.
This can be reverted once the code received more testing in
master

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-28 01:15:11 +01:00
Michael Niedermayer
b6691fba77 Merge commit '517ce1d09b5e6b72afc2ef9490b5f8ca42fa6a65' into release/2.4
* commit '517ce1d09b5e6b72afc2ef9490b5f8ca42fa6a65':
  lavu: fix memory leaks by using a mutex instead of atomics

Conflicts:
	libavutil/buffer.c

The atomics code is left in place as a fallback for synchronization in the
absence of p/w32 threads. Our ABI did not requires applications to
only use threads (and matching ones) to what libavutil was build with
Our code also was not affected by the leak this change fixes, though
no question the atomics based implementation is not pretty at all.
First and foremost the code must work, being pretty comes after that.

If this causes problems, for example when libavutil is used by multiple
applications each using a different kind of threading system then the
default possibly has to be changed to the uglier atomics.

See: cea3a63ba3
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-28 01:00:50 +01:00
Michael Niedermayer
15fd62110f Merge commit '46a17d886b8559723c40b9f5cdf0e0c6b1c95180' into release/2.4
* commit '46a17d886b8559723c40b9f5cdf0e0c6b1c95180':
  lavu: add wrappers for the pthreads mutex API

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-28 00:36:23 +01:00
Michael Niedermayer
86b532898d Merge commit '12700b0219521a5f20c8ba47b3ad7857ea9e0554' into release/2.4
* commit '12700b0219521a5f20c8ba47b3ad7857ea9e0554':
  mp3enc: fix a triggerable assert

Conflicts:
	libavformat/mp3enc.c

No change as the faulty assert is not in FFmpeg

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-28 00:35:35 +01:00
Anton Khirnov
ca78ee73db opusdec: make sure all substreams have the same number of coded samples
Fixes invalid writes with invalid multichannel streams.

CC:libav-stable@libav.org
(cherry picked from commit 1973079417)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-11-27 14:11:51 +01:00
wm4
517ce1d09b lavu: fix memory leaks by using a mutex instead of atomics
The buffer pool has to atomically add and remove entries from the linked
list of available buffers. This was done by removing the entire list
with a CAS operation, working on it, and then setting it back again
(using a retry-loop in case another thread was doing the same thing).

This could effectively cause memory leaks: while a thread was working on
the buffer list, other threads would allocate new buffers, increasing
the pool's total size. There was no real leak, but since these extra
buffers were not needed, but not free'd either (except when the buffer
pool was destroyed), this had the same effects as a real leak. For some
reason, growth was exponential, and could easily kill the process due
to OOM in real-world uses.

Fix this by using a mutex to protect the list operations. The fancy
way atomics remove the whole list to work on it is not needed anymore,
which also avoids the situation which was causing the leak.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit fbd6c97f9c)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-11-27 13:38:29 +01:00
Anton Khirnov
46a17d886b lavu: add wrappers for the pthreads mutex API
Also add no-op fallbacks when threading is disabled.

This helps keeping the code clean if Libav is compiled for targets
without threading. Since we assume that no threads of any kind are used
in such configurations, doing nothing is ok by definition.

Based on a patch by wm4 <nfxjfg@googlemail.com>.

(cherry picked from commit 2443e522f0)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-11-27 13:38:27 +01:00
Michael Niedermayer
944570906b avformat/avidec: fix handling dv in avi
Fixes Ticket4086

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f0ae0354d3)
2014-11-21 09:30:59 +01:00
Peter Ross
057ee35924 avfilter/vf_lut: gammaval709()
See http://www.itu.int/rec/R-REC-BT.709
Item 1.2, overall opto-electronic transfer characteristics at source

Signed-off-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b186b7131e)
2014-11-20 02:00:59 +01:00
Peter Ross
e386241d54 cinedec: report white balance gain coefficients using metadata
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 2093c1dc51)
2014-11-20 02:00:49 +01:00
Michael Niedermayer
222236317b swscale/utils: support bayer input + scaling, and bayer input + any supported output
Fixes Ticket4053

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 2f6bb86f85)
2014-11-20 02:00:35 +01:00
Michael Niedermayer
633a2a082f swscale: support internal scaler cascades
Fixes Ticket3170

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

Conflicts:
	libswscale/version.h
2014-11-20 02:00:15 +01:00
Michael Niedermayer
e5f5df37c8 avformat/dtsdec: dts_probe: check reserved bit, check lfe, check sr_code similarity
Fixes misdetection of s16le
Fixes Ticket4109

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0dba982bb4)
2014-11-20 01:29:20 +01:00
Michael Niedermayer
cc9c74ea87 avformat/segment: export inner muxer timebase
Fixes "Non-monotonous DTS in output stream 0:0"
Fixes Ticket4020

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ce80f9fee9)
2014-11-17 01:08:48 +01:00
Anton Khirnov
12700b0219 mp3enc: fix a triggerable assert
We have to check against the number of bytes actually needed, not the
theoretical maximum size.
2014-11-14 20:22:40 +01:00
Reimar Döffinger
3e0802e42b configure: Hack to treat x32 as x86_64.
Allows shared compilation on x32 with --disable-asm.
(cherry picked from commit 5e8e2f3861)
2014-11-13 08:24:55 +01:00
Michael Niedermayer
56e11cbe32 Revert "v4l2: setting device parameters early"
This reverts commit b1ad931233.

Fixes Ticket #3517

Requested-by: Giorgio Vazzana <mywing81@gmail.com>
Merged-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6f21fb7932)

Conflicts:
	libavdevice/v4l2.c
2014-11-08 14:21:46 +01:00
Carl Eugen Hoyos
2be7d565bb Remove fminf() emulation.
The emulation is unused and causes compilation trouble on systems
where fminf() is defined in <math.h> but missing from libm.
This should fix compilation on Debian powerpcspe.
(cherry picked from commit 4436a8f44d)
2014-11-08 12:47:18 +01:00
Michael Niedermayer
c7b64a904a avcodec/mpegaudio_parser: fix off by 1 error in bitrate calculation
Fixes Ticket3918

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 817663897e)
2014-11-06 01:02:53 +01:00
Carl Eugen Hoyos
9798dc8061 Use -fno-optimize-sibling-calls on parisc also for gcc 4.9.
Fixes fate on hppa.
Found-by: Andreas Cadhalpun.
(cherry picked from commit f2ffaae9ac)
2014-11-05 10:32:24 +01:00
Michael Niedermayer
a5cc8775cf avcodec/h264_sei: ff_h264_decode_sei: dont try to parse trailing zeroes
reduces noise for tserrors.ts

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 688a40b4ed)
2014-11-05 10:13:26 +01:00
Michael Niedermayer
f9ca1fecb0 ffmpeg_opt: store canvas size in decoder context
Fixes canvas size
Fixes Ticket4074

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 66b9e60af0)
2014-11-05 09:54:35 +01:00
Michael Niedermayer
cd57d608a4 avcodec/mpeg12dec: do not trust AVCodecContext input dimensions
Fixes initial wtv dimensions
Fixes Ticket4070
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 77f1199e8f)
2014-11-05 09:52:29 +01:00
Michael Niedermayer
043f326060 avcodec/h264_slice: Clear table pointers to avoid stale pointers
Might fix Ticket3889

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-02 02:10:51 +01:00
Michael Niedermayer
9a641b909c avcodec/h264_parser: rewrite the parse_nal_units() loop logic based on h264.c
Fixes Ticket4011

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 16:27:12 +01:00
Michael Niedermayer
5405ba7b63 avcodec/h264: simplify find_start_code()
this also uses avpriv_find_start_code(), though no speed change is expected as
the area searched is generally small

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 16:27:12 +01:00
Michael Niedermayer
70f6d553d9 Move get_avc_nalsize() and find_start_code() to h264.h
This allows sharing them with the h264 parser

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

Conflicts:

	libavcodec/h264.c
2014-11-01 16:27:12 +01:00
Reimar Döffinger
25fc3deed8 mpeg4vdpau: Fix priv data size.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
(cherry picked from commit 46353759cb)
2014-11-01 16:18:50 +01:00
Michael Niedermayer
a8a6cdfcd7 avformat/matroskadec: do not trust the default duration to be the real 1/timebase if its less than 5fps
Fixes Ticket3980

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit be695ee389)
2014-11-01 15:37:36 +01:00
Michael Niedermayer
39518589e7 avformat/options_table: add FF_COMPLIANCE_UNOFFICIAL
Fixes ticket 3959

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c02ea58c5f)
2014-11-01 15:36:07 +01:00
Carl Eugen Hoyos
857e391697 Stop demuxing wtv on eof.
Fixes ticket #3991.
Fixes ticket #3995.
Fixes ticket #3997.

Reviewed-by: Peter Ross
Reviewed-by: Paul B Mahol
(cherry picked from commit 6efe4137ce)
2014-11-01 15:35:46 +01:00
Michael Niedermayer
04aa2ffbcf Update for 2.4.3
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 13:39:52 +01:00
Michael Niedermayer
63523485f4 avcodec/svq1dec: zero terminate embedded message before printing
Fixes out of array access
Fixes: asan_stack-oob_49b1e5_10_009.mov
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e91ba2efa9)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 13:28:14 +01:00