61602 Commits

Author SHA1 Message Date
Michael Niedermayer
afcd152b97 Merge commit '2bcd8f22f2fae253d87b11a5c9f8805d79253180' into release/2.2
* commit '2bcd8f22f2fae253d87b11a5c9f8805d79253180':
  Treat all '*.pnm' files as non-text file

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-02 14:14:39 +01:00
Michael Niedermayer
dad7beaceb 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>
(cherry picked from commit 0e216ed40789e382eb6725d1cd0941927bfd1400)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-02 13:50:46 +01:00
Michael Niedermayer
93360af0d7 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>
(cherry picked from commit f783259fdb37e288643fe54ac162d723b1bec548)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-02 13:50:29 +01:00
Michael Niedermayer
4ed83378bf Merge commit 'c790e31ae46d4304af893d04806ec9e3bff5ae28' into release/2.2
* commit 'c790e31ae46d4304af893d04806ec9e3bff5ae28':
  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: cea3a63ba3d89d8403eef008f7a7c54d645cff70
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-02 13:48:18 +01:00
Dave Yeo
1579f14632 libavutil/threads.h: correct an include to be local
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 32eadfe453c32788ea57968e6e80f673f434739d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-02 13:37:37 +01:00
Dave Yeo
7394e53f30 libavutil/thread.h: Support OS/2 threads
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 090a7801a8817c1fbc6db0ed39070bf82255d8f2)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-02 13:37:32 +01:00
Michael Niedermayer
9bbed55b10 Merge commit '7fe5d0a78df537542732aa7bd45962f7505255d0' into release/2.2
* commit '7fe5d0a78df537542732aa7bd45962f7505255d0':
  lavu: add wrappers for the pthreads mutex API

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-02 13:36:31 +01:00
Michael Niedermayer
9181faab68 Merge commit '871d99ef77336069e5a8ece947c8160d9bc4d5ea' into release/2.2
* commit '871d99ef77336069e5a8ece947c8160d9bc4d5ea':
  mp3enc: fix a triggerable assert

Conflicts:
	libavformat/mp3enc.c

No change, the faulty assert was not in FFmpeg

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-02 13:14:06 +01:00
Reinhard Tartler
2bcd8f22f2 Treat all '*.pnm' files as non-text file
This convinces the pre-receive hook to not consider all *.pnm files as
text files to reduce the patch sizes and avoids triggering whitespace
checks,

Contains a correction by Janne Grunau <janne-libav@jannau.net>

(cherry picked from commit b877814e09b9f25308ec205cf48bb9554b33e95c)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-12-01 17:36:05 -08:00
wm4
c790e31ae4 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 fbd6c97f9ca858140df16dd07200ea0d4bdc1a83)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 517ce1d09b5e6b72afc2ef9490b5f8ca42fa6a65)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-11-27 13:45:36 +01:00
Anton Khirnov
7fe5d0a78d 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 2443e522f0059176ff8717c9c753eb6fe7e7bbf1)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 46a17d886b8559723c40b9f5cdf0e0c6b1c95180)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-11-27 13:45:28 +01:00
Michael Niedermayer
bf219a564c avformat/avidec: fix handling dv in avi
Fixes Ticket4086

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f0ae0354d3f04c369257c2a28557524d28c5df15)
2014-11-21 10:01:31 +01:00
Anton Khirnov
871d99ef77 mp3enc: fix a triggerable assert
We have to check against the number of bytes actually needed, not the
theoretical maximum size.

(cherry picked from commit 12700b0219521a5f20c8ba47b3ad7857ea9e0554)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-11-15 08:46:48 +01:00
Michael Niedermayer
418e9a6113 Revert "v4l2: setting device parameters early"
This reverts commit b1ad9312331759679a9c956233716a67ae681d89.

Fixes Ticket #3517

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

Conflicts:
	libavdevice/v4l2.c
2014-11-08 14:27:14 +01:00
Michael Niedermayer
e25e0903ab 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 817663897e59f45f60016fa9d3d16e325b803967)
2014-11-06 01:10:12 +01:00
Michael Niedermayer
969aee07e6 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 69a9a90d2ef795162074be24e3ad2182a8676af2)

Conflicts:

	libavcodec/h264_parser.c
n2.2.10
2014-11-01 18:27:12 +01:00
Michael Niedermayer
76587eea64 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 3b678da5e386c138316954e867d595f946666051)

Conflicts:

	libavcodec/h264.h
2014-11-01 18:26:22 +01:00
Michael Niedermayer
667fe8c75b 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 4898440f6bd19152373969159fff057b532c6374)

Conflicts:

	libavcodec/h264.c
	libavcodec/h264.h
2014-11-01 18:25:47 +01:00
Michael Niedermayer
64624c5678 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 be695ee389724d713e1b8a61ef899fe1795193ce)
2014-11-01 16:12:52 +01:00
Michael Niedermayer
114e4b970e avformat/mp3dec: Improve seeking frame sync code
Fixes Ticket3884

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 1b5ccae0f2045ac86bc9e1257cec1b3fba81315f)
2014-11-01 16:12:52 +01:00
Michael Niedermayer
c9659dfd29 avformat/mpeg: increase score for short mpeg-ps by 1
Fixes Ticket 3855

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

Conflicts:
	libavformat/mpeg.c
2014-11-01 16:12:52 +01:00
Michael Niedermayer
41ee9a4495 update for 2.2.10
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 16:01:28 +01:00
Michael Niedermayer
e812a089f5 avcodec/svq3: Dont memcpy AVFrame
This avoids out of array accesses

Fixes: asan_heap-uaf_21f42e4_9_asan_heap-uaf_21f42e4_278_gl2.mov

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 15:51:16 +01:00
Michael Niedermayer
9b8b35910f 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 e91ba2efa949470e9157b652535d207a101f91e0)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 15:40:38 +01:00
Michael Niedermayer
f00ec3307b avcodec/cook: check that the subpacket sizes fit in block_align
Fixes out of array read
Fixes: asan_heap-oob_fb5c50_19_018.rmvb
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 10e32618acce9c3fc64c061eb7907e8a8d2749ae)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 15:40:38 +01:00
Michael Niedermayer
f6499563c3 avcodec/g2meet: check tile dimensions to avoid integer overflow
Fixes out of array access
Fixes: asan_heap-oob_12a55d3_30_029.wmv
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 32e666c354e4a3160d8cf1d303cb51990b095c87)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 15:40:38 +01:00
Michael Niedermayer
16a4aef345 avcodec/utils: Align dimensions by at least their chroma sub-sampling factors.
Fixes: out of array accesses
Fixes: asan_heap-oob_112c6b3_13_012.avi
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit df74811cd53e45fcbbd3b77a1c42416816687c5c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 15:40:38 +01:00
Michael Niedermayer
6352153811 avcodec/dnxhddec: treat pix_fmt like width/height
Fixes out of array accesses
Fixes: asan_heap-oob_22c9a39_16_015.mxf
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f3c0e0bf6f53df0977f3878d4f5cec99dff8de9e)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 15:40:38 +01:00
Michael Niedermayer
557e8bd589 avcodec/dxa: check dimensions
Fixes out of array access
Fixes: asan_heap-oob_11222fb_21_020.dxa
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e70312dfc22c4e54d5716f28f28db8f99c74cc90)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 15:40:38 +01:00
Michael Niedermayer
45361d8aa3 avcodec/dirac_arith: fix integer overflow
Fixes: asan_heap-oob_1078676_9_008.drc
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 39680caceebfc6abf09b17032048752c014e57a8)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 15:40:38 +01:00
Michael Niedermayer
81e1b5f5fe avcodec/diracdec: Tighter checks on CODEBLOCKS_X/Y
Fixes very long but finite loop
Fixes: asan_heap-oob_107866c_42_041.drc
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 5145d22b88b9835db81c4d286b931a78e08ab76a)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 15:40:38 +01:00
Michael Niedermayer
6505eb45bc avcodec/diracdec: Use 64bit in calculation of codeblock coordinates
Fixes integer overflow
Fixes out of array read
Fixes: asan_heap-oob_107866c_42_041.drc
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 526886e6069636a918c8c04db17e864e3d8151c1)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 15:40:38 +01:00
Michael Niedermayer
17f0581e0d postproc: fix qp count
Found-by: ubitux
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0b7e5d0d75e7d8762dd04d35f8c0821736164372)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 15:40:38 +01:00
Michael Niedermayer
13b7962aae postproc/postprocess: fix quant store for fq mode
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 941aaa39e8cd78ba4d16dfcec767290aec9a0136)

Conflicts:

	tests/ref/fate/filter-pp3
2014-11-01 15:40:38 +01:00
Christophe Gisquet
aa40f11b81 utvideoenc: properly set slice height/last line
Mimic decoder and obey sampling.

Does not affect fate tests for utvideo.
Fixes ticket #3949.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 15:40:38 +01:00
Michael Niedermayer
3bb4c3e74d Merge commit '72ed4166a64714952777fb028b546a52e5b4e2c2' into release/2.2
* commit '72ed4166a64714952777fb028b546a52e5b4e2c2':
  resample: Avoid off-by-1 errors in PTS calcs.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 15:26:51 +01:00
Michael Niedermayer
7ac50d846c Merge commit '787a6156a2d887bb1d65c1233a94a61741e7af7c' into release/2.2
* commit '787a6156a2d887bb1d65c1233a94a61741e7af7c':
  imc: fix order of operations in coefficients read

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 15:26:20 +01:00
Michael Niedermayer
0f4c03cd63 Merge commit '0989a120f1dec400c54fcb54670cb84bba36d99b' into release/2.2
* commit '0989a120f1dec400c54fcb54670cb84bba36d99b':
  mpeg12: Always invoke the get_format() callback

Conflicts:
	libavcodec/mpeg12dec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 15:25:42 +01:00
Michael Niedermayer
2d1d053c5d Merge commit 'c7caed88a03567e8777a606f4bd42f093c6b302c' into release/2.2
* commit 'c7caed88a03567e8777a606f4bd42f093c6b302c':
  h264: Always invoke the get_format() callback

Conflicts:
	libavcodec/h264.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 15:08:51 +01:00
Timothy B. Terriberry
72ed4166a6 resample: Avoid off-by-1 errors in PTS calcs.
The rounding used in the PTS calculations in filter_frame() does
not actually match the number of samples output by the resampler.
This leads to off-by-1 errors in the timestamps indicating gaps and
underruns, even when the input timestamps are all contiguous.

Bug-Id: 753

Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 6cbbf0592f4f3940aac7f687850d1b726a2ea836)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit ca8c62d187fdca13979379fb2ab172ed662aa2f8)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-10-18 05:15:48 +02:00
Vittorio Giovara
787a6156a2 imc: fix order of operations in coefficients read
Reported-by: Ruoyu <liangry@ucweb.com>
2014-10-15 14:54:20 +01:00
Michael Niedermayer
b05d355040 Update for 2.2.9
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
n2.2.9
2014-10-06 03:47:59 +02:00
James Almer
f253fa9552 x86/synth_filter: add missing HAVE_YASM guard
Should fix compilation failures with --disable-yasm on some compilers

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

Conflicts:

	libavcodec/x86/dcadsp_init.c
2014-10-06 01:50:01 +02:00
Michael Niedermayer
a28c276b8d swresample/swresample: fix sample drop loop end condition
Fixes Ticket3985

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-06 01:31:18 +02:00
Michael Niedermayer
26da47a09b avcodec/h264: Check mode before considering mixed mode intra prediction
Fixes out of array read
Fixes: asan_heap-oob_e476fc_2_asan_heap-oob_1333ec6_61_CAMACI3_Sony_C.jsv

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-05 14:22:09 +02:00
Michael Niedermayer
23fdcd3b0a avformat/mpegts: Check desc_len / get8() return code
Fixes out of array read
Fixes: signal_sigsegv_844d59_10_signal_sigsegv_a17bb7_366_mpegts_mpeg2video_mp2_dvbsub_topfield.rec

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-05 14:22:08 +02:00
Michael Niedermayer
653329dfcb avcodec/vorbisdec: Fix off by 1 error in ptns_to_read
Fixes read of uninitialized memory
Fixes: asan_heap-uaf_18dac2b_9_asan_heap-uaf_22eb375_208_beta3_test_small.ogg

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-05 14:22:08 +02:00
Michael Niedermayer
b0964918d8 avcodec/smc: fix off by 1 error
Fixes out of array access
Fixes: asan_heap-oob_1685bf0_5_asan_heap-oob_1f35116_430_smc.mov

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-05 14:20:32 +02:00
Michael Niedermayer
d8fda618d0 avcodec/qpeg: fix off by 1 error in MV bounds check
Fixes out of array access
Fixes: asan_heap-oob_153760f_4_asan_heap-oob_1d7a4cf_164_VWbig6.avi

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-05 14:20:32 +02:00
Michael Niedermayer
43881c7732 avcodec/gifdec: factorize interleave end handling out
also change it to a loop
Fixes out of array access
Fixes: asan_heap-oob_ca5410_8_asan_heap-oob_ca5410_97_ID_LSD_Size_Less_Then_Data_Inter_3.gif

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-05 14:20:32 +02:00