3063 Commits

Author SHA1 Message Date
Michael Niedermayer
c701506525 avutil/pca: Check for av_malloc* failures
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit dadc43eee4d9036aa532665a04720238cc15e922)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-07 12:43:05 +02:00
James Almer
0b51e0baea avutil/cpu: add missing check for mmxext to av_force_cpu_flags
Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 1f5d1eed78fad63f1c80a3766d3dc2421b99104d)
2015-03-28 22:12:31 -03:00
Michael Niedermayer
bec350611e Merge commit '7fd11fbeeb41990427b475dc0d8800d2cf15a8c4' into release/2.2
* commit '7fd11fbeeb41990427b475dc0d8800d2cf15a8c4':
  arm: Suppress tags about used cpu arch and extensions

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-09 12:48:18 +01:00
Martin Storsjö
7fd11fbeeb arm: Suppress tags about used cpu arch and extensions
When all the codepaths using manually set .arch/.fpu code is
behind runtime detection, the elf attributes should be suppressed.

This allows tools to know that the final built binary doesn't
strictly require these extensions.

Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit dcae2e32f7d8a1ca5fb8c1e4aa81313be854dd73
and b77e335e441040a40fc6156b8e4a134745d10233)
Signed-off-by: Martin Storsjö <martin@martin.st>
2015-03-08 18:12:02 +02:00
Michael Niedermayer
8323f09442 avutil/opt: Fix type used to access AV_OPT_TYPE_SAMPLE_FMT
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 1750b45cdf7498d0a05bea29cafcb26aa576d595)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-17 19:43:18 +01:00
Michael Niedermayer
68d83bc3a6 avutil/opt: Fix types used to access AV_OPT_TYPE_PIXEL_FMT
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a0640e63463e6428b80422c89e1bfc96147ecfc6)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-17 19:43:18 +01:00
Michael Niedermayer
3769601fb6 Add FFMPEG_VERSION into the binary libs
This simplifies identifying from which revision a binary of a lib came from

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

Conflicts:

	libavdevice/avdevice.c
	libswresample/swresample.c
2015-01-20 03:27:17 +01:00
wm4
b9510b3274 lavu/frame: fix malloc error path in av_frame_copy_props()
The error path frees all side data, but forgets to reset the side data
count. This can blow up later in av_frame_unref() and free_side_data().

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-20 03:27:17 +01:00
Lukasz Marek
9440079216 lavu/opt: fix av_opt_get function
Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
(cherry picked from commit 173d51c982f1ecaa8d28cd0d8611164be0c9d36d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-08 19:08:30 +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
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
lvqcl
be894938c4 avutil/x86/cpu: fix cpuid sub-leaf selection
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e58fc44649d07d523fcd17aa10d9eb0d3a5ef3f4)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-05 14:20:32 +02:00
Philip DeCamp
fe0fd3de22 libavutil/opt: fix av_opt_set_channel_layout() to access correct memory address
Signed-off-by: Philip DeCamp <decamp@mit.edu>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 857fc0a71f1b52fbba3281ba64b5a35195458622)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-05 14:20:32 +02:00
Michael Niedermayer
ffc66ac0d6 avutil/cpu: add aarch64 entries to 2nd table
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit efc4fe9d74a5040e465dbff80b29468dbc227c19)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-11 19:07:11 +02:00
Michael Niedermayer
90a1c5e95c Merge commit 'a5992a274ff5f6c4bec3445cb410da0adce8ef70' into release/2.2
* commit 'a5992a274ff5f6c4bec3445cb410da0adce8ef70':
  stereo3d: add missing include guards

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-11 18:38:27 +02:00
Vittorio Giovara
a5992a274f stereo3d: add missing include guards 2014-08-06 12:44:35 +01:00
Michael Niedermayer
d832020bd8 Merge commit '6d899d0206e91a3a74680b47ec06ef1dbc151c21' into release/2.2
* commit '6d899d0206e91a3a74680b47ec06ef1dbc151c21':
  lzo: Handle integer overflow

Conflicts:
	libavutil/lzo.c

This is basically not merging changes due to this being fixed differently
in FFmpeg

See: d6af26c55c1ea30f85a7d9edbc373f53be1743ee
See: cf2b7c01f81c1fb3283a1390c0ca9a2f81f4f4a8

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-14 22:24:36 +02:00
Luca Barbato
6d899d0206 lzo: Handle integer overflow
get_len can overflow for specially crafted payload.

Reported-By: Don A. Baley <donb@securitymouse.com>
CC: libav-stable@libav.org
(cherry picked from commit ccda51b14c0fcae2fad73a24872dce75a7964996)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-06-25 15:37:01 +02:00
Michael Niedermayer
61796a8999 avutil/lzo: add asserts to be double sure against overflows
These asserts cannot fail since d6af26c55c1ea30f85a7d9edbc373f53be1743ee

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-23 15:04:07 +02:00
Michael Niedermayer
7d9c059a35 avutil/lzo: Fix integer overflow
Embargoed-till: 2014-06-27 requested by researcher, but embargo broken by libav today (git and mailing list)

Fixes: LMS-2014-06-16-4
Found-by: "Don A. Bailey" <donb@securitymouse.com>
See: ccda51b14c0fcae2fad73a24872dce75a7964996
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d6af26c55c1ea30f85a7d9edbc373f53be1743ee)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-23 15:04:05 +02:00
Michael Niedermayer
d575984dfc avutil/cpu: force mmx on selection of higher x86 SIMD features
Fixes various runtime failures with manually set flags that represent no
existing CPU

Fixes Ticket3653

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-02 22:59:49 +02:00
Michael Niedermayer
5cd2cdf33f Merge commit '0ec75a04e5fc714bc3cd6e2a6b783e6df834ad01' into release/2.2
* commit '0ec75a04e5fc714bc3cd6e2a6b783e6df834ad01':
  ppc: Fix compilation for ppc64le (ELFv2)
  aarch64: Use the correct syntax for relocations

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-02 22:34:22 +02:00
Martin Storsjö
34fb994d93 aarch64: Use the correct syntax for relocations
This fixes building in PIC mode with gas. The examples in the gas
manual showed using a # here even though gas itself actually didn't
support that syntax (and the gas test suite only tests it without
the extra hash sign).

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 08cd92144e73195eecc28ed0348e66e255516b82)
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-05-29 14:48:13 +03:00
Michael Niedermayer
56f44c26f0 avutil/avstring: do not lose ascii characters when decoding non utf-8 with av_utf8_decode()
Fixes Ticket3363

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a31547ce2e5c46d7a7005fe70dcf9b3a7c5fc4ac)
2014-04-16 19:20:20 +02:00
Lukasz Marek
fc8eb4c1f9 lavu/opt: validate range before dereference
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 3aac5fcfa9d3748659d78ab2a66d0ccce22cfd4f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-10 04:53:00 +02:00
James Almer
1103aec1df x86/cpu: check for OS support before enabling AVX2
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 2d9821a2081aff5dca253386c6e7e71a04509cff)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-27 11:20:56 +01:00
Michael Niedermayer
70e3cc282b avutil/timestamp: Warn about missing __STDC_FORMAT_MACROS for C++ use
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8b02dfd37cb3bc9521fc6e1f5b5f13c80d144cd2)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-15 02:42:11 +01:00
Michael Niedermayer
ff1e982205 Merge commit '45acc228a6d5f1e7d6c5ce6da63b293bd5eda57d' into release/2.2
* commit '45acc228a6d5f1e7d6c5ce6da63b293bd5eda57d':
  doc: fix a couple of typos in frame.h

Conflicts:
	libavutil/frame.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 12:09:13 +01:00
Michael Niedermayer
3e4b957847 Merge commit '0ede7b534483c5c90f404a8f11f776d2f2da4e7e' into release/2.2
* commit '0ede7b534483c5c90f404a8f11f776d2f2da4e7e':
  float_dsp: fix errors in documentation

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 11:22:10 +01:00
Michael Niedermayer
123981930f Merge commit 'a1ab3300c83a16c2d5f5d29c51393668b9d92667' into release/2.2
* commit 'a1ab3300c83a16c2d5f5d29c51393668b9d92667':
  arm: hpeldsp: prevent overreads in armv6 asm

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 10:31:47 +01:00
Lukasz Marek
3171e2360a Revert "lavu/buffer: add release function"
This reverts commit 3144440004941aa22ffea9933f5e5dfe826df654.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 09:06:51 +01:00
Janne Grunau
45acc228a6 doc: fix a couple of typos in frame.h
(cherry picked from commit a18ef7a76c735bcf78ed4825e33ad7f9f6f77a54)
2014-03-09 17:53:09 -04:00
Janne Grunau
0ede7b5344 float_dsp: fix errors in documentation
(cherry picked from commit 74cc901905741ca3d9e8364f42239341f4f173c4)
2014-03-08 19:36:20 -05:00
Janne Grunau
a1ab3300c8 arm: hpeldsp: prevent overreads in armv6 asm
Based on a patch by Russel King <rmk+libav@arm.linux.org.uk>

Bug-Id: 646
CC: libav-stable@libav.org
2014-03-05 16:21:52 +01:00
Martin Storsjö
cd6281abef arm: Mark the stack as non-executable
If linking in an object file without this attribute set, the
linker will assume that an executable stack might be needed.

Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 543156d7518f5e5d731123da066d86278f9fa492)
2014-03-02 11:42:37 -05:00
Michael Niedermayer
52d928daf9 avutil/opt: allow max=min=0 for pixel formats
This is neccessary for maintaining ABI compatibility with FFmpeg 2.1

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-01 00:31:38 +01:00
Lukasz Marek
3144440004 lavu/buffer: add release function
new function allows to unref buffer and obtain its data.

Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-25 01:38:52 +01:00
Michael Niedermayer
74bb1ca82c avutil/frame_copy_audio: also check that channels match
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-24 10:12:33 +01:00
Michael Niedermayer
fff5262301 Merge commit '1155fd02ae7bac215acab316e847c6bb25f74fc3'
* commit '1155fd02ae7bac215acab316e847c6bb25f74fc3':
  frame: add a convenience function for copying AVFrame data

Conflicts:
	doc/APIchanges
	libavutil/frame.c
	libavutil/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-24 09:38:32 +01:00
James Almer
3f3d748cab x86: Move XOP emulation to x86util
We need the emulation to support the cases where the first
argument is the same as the fourth. To achieve this a fifth
argument working as a temporary may be needed.
Emulation that doesn't obey the original instruction semantics
can't be in x86inc.

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-24 08:30:19 +01:00
Anton Khirnov
1155fd02ae frame: add a convenience function for copying AVFrame data 2014-02-24 07:25:07 +01:00
Michael Niedermayer
bd8d73ea8b Merge remote-tracking branch 'qatar/master'
* qatar/master:
  x86: add detection for Bit Manipulation Instruction sets

Conflicts:
	libavutil/x86/cpu.c

See: 0bc3de19ffe296254f214dc7615e624d8e401bcb
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-23 22:52:58 +01:00
Michael Niedermayer
d9574069c1 Merge commit '1b932eb1508f550fac9e911923a0383efda53aa3'
* commit '1b932eb1508f550fac9e911923a0383efda53aa3':
  x86: add detection for FMA3 instruction set

Conflicts:
	configure
	libavutil/cpu.h
	libavutil/x86/cpu.c

See: a2af8eddab75f1eac712411e4dde89823c0845e8
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-23 22:43:08 +01:00
James Almer
d59fcdaff3 x86: add detection for Bit Manipulation Instruction sets
Based on x264 code

Signed-off-by: James Almer <jamrial@gmail.com>
2014-02-23 15:29:36 +01:00