Commit Graph

41328 Commits

Author SHA1 Message Date
Vittorio Giovara
4438c25638 vf_interlace: remove the warning tag in the message
The log level is already a warning.
2015-01-05 15:35:46 +01:00
Vittorio Giovara
15ea222778 vf_interlace: merge FIELD_LOWER check 2015-01-05 15:35:46 +01:00
Vittorio Giovara
046f75a970 vf_interlace: also assert for height 2015-01-05 15:35:46 +01:00
Vittorio Giovara
696141e898 vf_interlace: use image width rather than linesize
Based on a patch by Michael Niedermayer <michaelni@gmx.at>.
2015-01-05 15:35:46 +01:00
Agostino Sarubbo
fe08299868 build: Use -Werror=format-security
Reduce the chance of introducing a class of bugs quite hard to track.
2015-01-05 15:35:39 +01:00
Stefano Pigozzi
2cef68da69 vda: error out if decoded CVPixelBuffer is empty
On some video samples, VDA silently fails to decode frames and returns
kVDADecoderNoErr. Error out in these cases to avoid producing AVFrames with
empty planes.

Signed-off-by: Stefano Pigozzi <stefano.pigozzi@gmail.com>
2015-01-05 15:35:39 +01:00
Diego Biurrun
0352ff102d ffv1: const correctness for encode_rgb_frame()
libavcodec/ffv1enc.c:922:53: warning: passing argument 5 of ‘encode_rgb_frame’ discards ‘const’ qualifier from pointer target type
2015-01-05 15:35:39 +01:00
Diego Biurrun
ca09effb01 ffv1: Drop unnecessary casts and const qualifiers to match function signatures
libavcodec/ffv1dec.c:898:36: warning: cast discards ‘const’ qualifier from pointer target type
2015-01-05 15:35:39 +01:00
Vittorio Giovara
1dd797e3c9 swscale: check memory allocations
CC: libav-stable@libav.org
Bug-Id: CID 1257779
2015-01-05 15:35:39 +01:00
Vittorio Giovara
07a0c0f000 opt: check memory allocation
CC: libav-stable@libav.org
Bug-Id: CID 1257771
2015-01-05 14:58:20 +01:00
Martin Storsjö
46808fdf04 movenc: Enable editlists by default if delay_moov is enabled
Being able to write editlists properly is one of the main points
in the delay_moov flag.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-01-04 20:04:36 +02:00
Martin Storsjö
9f810a9b37 libavformat: Check for malloc failures in avformat_new_stream
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2015-01-04 20:04:36 +02:00
Martin Storsjö
c4aa0f865f libavformat: Remove a misleading/incorrect comment
This comment can be traced back to the initial commit from 2001,
and it seemed to be misleading/incorect already back then. (It
was used for normal, non-raw file formats already then.)

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-01-04 20:04:33 +02:00
Martin Storsjö
f4d4e66a24 configure: Remap -L to -libpath for msvc
This allows using libraries that are detected via pkg-config with
msvc. (The libraries themselves may have to be built with MSVC
though.)

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-01-04 19:57:34 +02:00
Johan Andersson
3e16065221 cmdutils: update copyright year to 2015.
Signed-off-by: Martin Storsjö <martin@martin.st>
2015-01-04 13:22:25 +02:00
Martin Storsjö
f2ad1495f2 avisynth: Use RTLD_LOCAL instead of RTLD_GLOBAL
There shouldn't be any need to add the loaded libraries to the global
symbol namespace.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-01-03 02:30:03 +02:00
Martin Storsjö
470c9db11f sidxindex: Remove parsing that isn't necessary any longer
When we don't adjust the Period start time, we don't need to
parse the earliest_presentation_time from the sidx boxes either.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-01-03 01:24:30 +02:00
Martin Storsjö
5cf6bda6e2 sidxindex: Don't adjust the Period start time depending on the track start time
This was only necessary to get playback to start with dash.js 1.2.0,
it has been fixed in the git version.

The previous behaviour was incorrect - the Period's start time
is irrespective of the actual first timestamp of the contents
within the period. The Period start time only says when, within the
global timeline, this particular piece should start to be played
back.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-01-03 01:24:29 +02:00
Martin Storsjö
7a1a63e34f dashenc: Use pts for MPD timeline timestamps
This should be more correct. This also should give more sensible
switching between video streams with different amount of b-frame
delay.

The current dash.js release (1.2.0) fails to start playback of
such files from the start (if the start pts is > 0), but this has
been fixed in the current git version of dash.js.

Also enable the use of edit lists, so that streams in many cases
start at pts=0.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-01-03 01:22:09 +02:00
Martin Storsjö
c5e7ea13d2 dashenc: Use delay_moov
Signed-off-by: Martin Storsjö <martin@martin.st>
2015-01-03 01:20:55 +02:00
Martin Storsjö
b3b0b35db2 movenc: Get rid of a hack for updating the dvc1 atom
Use the more generic approach with the delay_moov flag, instead of
having a update mechanism specific to this one single atom.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-01-03 01:20:40 +02:00
Martin Storsjö
847bf5988f movenc: Add an option for delaying writing the moov with empty_moov
This delays writing the moov until the first fragment is written,
or can be flushed by the caller explicitly when wanted. If the first
sample in all streams is available at this point, we can write
a proper editlist at this point, allowing streams to start at
something else than dts=0. For AC3 and DNXHD, a packet is
needed in order to write the moov header properly.

This isn't added to the normal behaviour for empty_moov, since
the behaviour that ftyp+moov is written during avformat_write_header
would be changed. Callers that split the output stream into header+segments
(either by flushing manually, with the custom_frag flag set, or by
just differentiating between data written during avformat_write_header
and the rest) will need to be adjusted to take this option into use.

For handling streams that start at something else than dts=0, an
alternative would be to use different kinds of heuristics for
guessing the start dts (using AVCodecContext delay or has_b_frames
together with the frame rate), but this is not reliable and doesn't
necessarily work well with stream copy, and wouldn't work for getting
the right initialization data for AC3 or DNXHD either.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-01-03 01:19:27 +02:00
Martin Storsjö
c725faebda movenc: Use start_dts/cts instead of cluster[0] for writing edit lists
This allows writing edit lists even when track->entry == 0, if
the start times have been set.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-01-03 01:18:52 +02:00
Martin Storsjö
724cbea719 movenc: Remove an unnecessary condition when flushing fragments
If fragments == 0 it means we haven't written any moov atom yet.
If the empty_moov flag is set, we already have written an empty moov
atom at startup. Thus, the check for empty_moov is redundant.

This is in preparation for allowing writing the moov atom later,
even when using the empty moov flag.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-01-03 01:18:38 +02:00
Martin Storsjö
355d01a1bf movenc: Factorize writing ftyp and other identification tags to a separate function
Signed-off-by: Martin Storsjö <martin@martin.st>
2015-01-03 01:18:28 +02:00
Martin Storsjö
8d54bacb78 dashenc: Remove some stray double spaces
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-12-29 23:26:43 +02:00
Martin Storsjö
b91a5757fc dashenc: Fix writing of timelines that don't start at t=0
When writing an explicit time, reset the cur_time variable to this
value as well. This avoids writing excessive time attributes for each
segment in the timeline, as long as the segments are continuous.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-12-29 23:26:25 +02:00
Martin Storsjö
50036c30df fate: Use bitexact conversions in the dpxparser test
This fixes fate on e.g. ppc.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-12-29 23:21:43 +02:00
Anton Khirnov
60d4c6ff76 h264: restore a block mistakenly removed in e10fd08a
CC: libav-stable@libav.org
Bug-ID: 781
2014-12-27 10:44:48 +01:00
Rémi Denis-Courmont
737d35e334 vdpau: add support for the H.264 High 4:4:4 Predictive profile
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-12-25 20:47:49 +01:00
Rémi Denis-Courmont
1f9237f2ac avconv_vdpau: allocate video surface of VDPAU-specified size
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-12-25 20:47:49 +01:00
Rémi Denis-Courmont
ebd5320afd vdpau: add support for 4:2:2 and 4:4:4 chroma sampling
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-12-25 20:47:49 +01:00
Rémi Denis-Courmont
c220a60f92 vdpau: add helper for surface chroma type and size
Since the VDPAU pixel format does not distinguish between different
VDPAU video surface chroma types, we need another way to pass this
data to the application.

Originally VDPAU in libavcodec only supported decoding to 8-bits YUV
with 4:2:0 chroma sampling. Correspondingly, applications assumed that
libavcodec expected VDP_CHROMA_TYPE_420 video surfaces for output.
However some of the new HEVC profiles proposed for addition to VDPAU
would require different depth and/or sampling:
http://lists.freedesktop.org/archives/vdpau/2014-July/000167.html
...as would lossless AVC profiles:
http://lists.freedesktop.org/archives/vdpau/2014-November/000241.html

To preserve backward binary compatibility with existing applications,
a new av_vdpau_bind_context() flag is introduced in a further change.

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-12-25 20:47:49 +01:00
Rémi Denis-Courmont
6c99c92a42 libavcodec: add AV_HWACCEL_ALLOW_HIGH_DEPTH flag
This can be used by the application to signal its ability to cope with
video surface of types other than 8-bits YUV 4:2:0.

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-12-25 20:47:49 +01:00
Rémi Denis-Courmont
57b6704ecd avcodec: add AVCodecContext.sw_pix_fmt
This carries the pixel format that would be used if it were not for
hardware acceleration. This is equal to AVCodecContext.pix_fmt if
hardware acceleration is not in use.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-12-25 20:47:49 +01:00
Rémi Denis-Courmont
4cfbeef31d h264: factor hwaccel pixel formats list
This is to avoid proliferation of similar tables in following changes.

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-12-25 20:47:48 +01:00
Kieran Kunhya
9cfa68c560 mpegts: add support for Opus
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-12-20 11:29:19 +01:00
Martin Storsjö
8ebf02f8f5 libavformat: Only use MoveFileExA when targeting the desktop API subset
The MoveFileExA is available in the headers regardless which API
subset is targeted, but it is missing in the Windows Phone link
libraries. When targeting Windows Store apps, the function is
available both in the headers and in the link libraries, and thus
there is no indication for the build system that this function
should be avoided - such an indication is only given by the
Windows App Certification Kit, which forbids using the MoveFileExA
function.

Therefore check the WINAPI_FAMILY defines instead, to figure out
which API subset is targeted.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-12-19 23:24:47 +02:00
Martin Storsjö
fc308b30bb rtpenc_mpegts: Call write_trailer for the mpegts muxer even if no output buffer exists
Since the mpegts muxer now can handle being called with a NULL
AVIOContext, we don't need to try to allocate one before calling
write_trailer.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-12-19 23:14:45 +02:00
Martin Storsjö
e2ce163922 mpegts: Support running the write_trailer function without an AVIOContext
If opening and closing dynamic buffers as AVIOContext, we may
not have any AVIOContext available when wanting to close and
deallocate the muxer. Allow calling write_trailer despite this.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-12-19 23:13:04 +02:00
Martin Storsjö
4895aa65c6 libavformat: Allow calling av_write_trailer with a NULL AVIOContext
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-12-19 23:12:58 +02:00
Michael Niedermayer
cee4490b52 on2avc: check number of channels
Fixes invalid memory access.

CC: libav-stable@libav.org
Bug-ID: CVE-2014-8549
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-12-19 08:01:47 +01:00
Michael Niedermayer
d423dd72be smc: fix the bounds check
Fixes invalid writes when there are more blocks in a run than total
remaining blocks.

CC: libav-stable@libav.org
Bug-ID: CVE-2014-8548
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-12-19 08:01:47 +01:00
Michael Niedermayer
0b39ac6f54 gifdec: refactor interleave end handling
Fixes invalid writes with very small image heights.

CC: libav-stable@libav.org
Bug-ID: CVE-2014-8547
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-12-19 08:01:47 +01:00
Anton Khirnov
17ba719d9b mmvideo: check frame dimensions
The frame size must be set by the caller and each dimension must be a
multiple of 2.

CC: libav-stable@libav.org
Bug-ID: CVE-2014-8543
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
2014-12-19 08:01:46 +01:00
Anton Khirnov
88626e5af8 jvdec: check frame dimensions
The frame size must be set by the caller and each dimension must be a
multiple of 8.

CC: libav-stable@libav.org
Bug-ID: CVE-2014-8542
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
2014-12-19 08:01:46 +01:00
Anton Khirnov
809c3023b6 mjpegdec: check for pixel format changes
Fixes possible invalid memory access.

Based on code by Michael Niedermayer <michaelni@gmx.at>

CC: libav-stable@libav.org
Bug-ID: CVE-2014-8541
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
2014-12-19 08:01:46 +01:00
Anton Khirnov
64f7575fbd mov: avoid a memleak when multiple stss boxes are present
CC: libav-stable@libav.org
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
2014-12-19 08:01:46 +01:00
Vittorio Giovara
210461c0a8 imgconvert: check memory allocations and propagate errors 2014-12-18 23:27:14 +01:00
Vittorio Giovara
596b5c488f wma: check memory allocations and propagate errors 2014-12-18 23:27:14 +01:00