1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00
Commit Graph

18854 Commits

Author SHA1 Message Date
Michael Niedermayer
9dd4dcde9c avformat/avienc: Use avi_write_packet_internal() to store raw rgb in a more spec compliant way
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-18 21:26:50 +01:00
Diego Biurrun
0d1229f1d2 voc: Split ff_voc_get_packet into a separate file 2016-02-18 15:35:46 +01:00
Diego Biurrun
624e235502 build: Introduce iso_media component 2016-02-18 15:35:46 +01:00
Diego Biurrun
82454c3a82 build: Let the WTV demuxer select the MPEG-TS demuxer
The WTV demuxer depends on large parts of the MPEG-TS demuxer internals
anyway and fails to build without it.
2016-02-18 15:35:45 +01:00
Diego Biurrun
29c2d06d67 cosmetics: Drop empty comment lines 2016-02-18 15:35:30 +01:00
Moritz Barsnick
6eaad752c1 lavf/options_table: mark use_wallclock_as_timestamps as boolean
It is only used in a boolean context. Also clarify its documentation.

Signed-off-by: Moritz Barsnick <barsnick@gmx.net>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-18 15:24:31 +01:00
Michael Niedermayer
07c7e71d20 avformat/avienc: Split avi_write_packet_internal() out
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-18 14:40:06 +01:00
Michael Niedermayer
090b673aba avformat: add ff_reshuffle_raw_rgb()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-18 14:40:06 +01:00
Johan Ström
6c31c99289 hlsenc: add use_localtime_mkdir option to automatically create time-based directory
Use with -use_localtime, and set -hls_segment_filename to a path which
contains a subdirectory i.e. /some/path/%Y%m%d/%Y%m%dT%H%M%S-%s.ts
This will mkdir the %Y%m%d-part of the path if it does not already
exist.
In addition, each filename in the playlist output will be prefixed with
this subdirectory (if playlist and segment shares the same base path).

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-17 16:17:58 +01:00
Michael Niedermayer
58f21b6c93 avformat/hls: fix potential integer overflow
This is not a regression

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-16 21:46:00 +01:00
Derek Buitenhuis
00bd237499 mov: Fix leftover merge conflict cruft
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-02-16 20:09:56 +00:00
Derek Buitenhuis
4e3185d208 Merge commit '5eb562831b3a9bea8026c413ef1338e06450d005'
This commit is a no-op.

* commit '5eb562831b3a9bea8026c413ef1338e06450d005':
  mov: Use the correct type for size

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-02-16 20:07:08 +00:00
Derek Buitenhuis
0479cf8530 Merge commit 'e579d8b29cdb9b42c50a0fde277dfb047c1466ad'
* commit 'e579d8b29cdb9b42c50a0fde277dfb047c1466ad':
  lavf: Dump the cpb side data information

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-02-16 19:51:02 +00:00
Vittorio Giovara
b92962436b mov: Fix the format specifier type for size
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2016-02-16 18:25:47 +01:00
Derek Buitenhuis
56475e885b Merge commit 'e80307140f736f593ee643affa015333d7c5e27f'
* commit 'e80307140f736f593ee643affa015333d7c5e27f':
  yuv4mpegenc: Use AV_CEIL_RSHIFT where needed

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-02-16 16:57:32 +00:00
Derek Buitenhuis
d0fc5de3a6 Merge commit '81306fd4bdeb5c17d4db771e4fec684773b5790f'
* commit '81306fd4bdeb5c17d4db771e4fec684773b5790f':
  hls: eliminate ffurl_* usage

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-02-16 16:27:14 +00:00
Michael Niedermayer
b4018544fb avformat/img2enc: remove unused variable
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-14 21:30:53 +01:00
Michael Niedermayer
dcb6d5b831 avformat/genh: Mark coef_splitted as av_unused
This avoid "libavformat/genh.c:43:14: warning: variable coef_splitted set but not used"
Fewer warnings makes it easier to see new and important warnings

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-14 21:05:50 +01:00
Mark Reid
8395b6eeaa libavcodec/dnxhd_parser: add parser and probe support raw 444 and dnxhr formats
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-14 19:17:36 +01:00
David Monro
4b750104ea lavf/spdifenc: Support MLP encapsulation.
Fixes bug 821.

Signed-off-by: Carl Eugen Hoyos <cehoyos@ag.or.at>
2016-02-14 18:02:22 +01:00
Alex Agranovsky
ddda2cc43c lavf/mpjpeg: do not include CRLF preceding boundary as part of the returned frame
Signed-off-by: Alex Agranovsky <alex@sighthound.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-14 13:48:33 +01:00
Alex Agranovsky
09b8e97ab6 lavf/mpjpeg: Trim quotes on MIME boundary, if present.
Fixes 5023

Signed-off-by: Alex Agranovsky <alex@sighthound.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-14 12:31:08 +01:00
Luca Barbato
5eb562831b mov: Use the correct type for size
An AVIO offset is int64_t.

Bug-Id: 921
2016-02-14 11:44:38 +01:00
Marton Balint
a573e6c103 avformat/utils: remove ff_iso8601_to_unix_time
Signed-off-by: Marton Balint <cus@passwd.hu>
2016-02-14 01:51:14 +01:00
Marton Balint
66e85a180a avformat/matroskaenc: use ff_parse_creation_time_metadata
Also increase precision to microsecs, and avoid writing creation_time as a
simple tag metadata item.

Signed-off-by: Marton Balint <cus@passwd.hu>
2016-02-14 01:51:14 +01:00
Marton Balint
ad17cc9744 avformat/mxfenc: use ff_parse_creation_time_metadata
Signed-off-by: Marton Balint <cus@passwd.hu>
2016-02-14 01:51:14 +01:00
Marton Balint
5f64f3d8cf avformat/movenc: use ff_parse_creation_time_metadata
Signed-off-by: Marton Balint <cus@passwd.hu>
2016-02-14 01:51:14 +01:00
Marton Balint
5c20bc8f47 avformat/gxfenc: use ff_parse_creation_time_metadata
Signed-off-by: Marton Balint <cus@passwd.hu>
2016-02-14 01:51:14 +01:00
Marton Balint
83b01ed212 avformat/ffmenc: use ff_parse_creation_time_metadata
FYI this muxer bails out on parse error and not just warn the user.

Signed-off-by: Marton Balint <cus@passwd.hu>
2016-02-14 01:51:14 +01:00
Marton Balint
bf0607b6db avformat/dvenc: use ff_parse_creation_time_metadata
Signed-off-by: Marton Balint <cus@passwd.hu>
2016-02-14 01:51:14 +01:00
Marton Balint
ea1bf08a4c avformat/asfenc: use ff_parse_creation_time_metadata
Signed-off-by: Marton Balint <cus@passwd.hu>
2016-02-14 01:51:14 +01:00
Marton Balint
e942454daf avformat/utils: add ff_parse_creation_time_metadata
Signed-off-by: Marton Balint <cus@passwd.hu>
2016-02-14 01:51:14 +01:00
Marton Balint
35890aaa65 avformat/img2enc: disable atomic file creation by default
Currently it is broken when explicitly using the file protocol, it uses an
insecure temporary file name, and in commit b4431c80 disabling the option by
default was already considered. Also it is not very consistent to have such an
option for one particular muxer.

Signed-off-by: Marton Balint <cus@passwd.hu>
2016-02-14 01:34:16 +01:00
Marton Balint
0250fc2146 avformat/img2enc: return error if image rename fails
Signed-off-by: Marton Balint <cus@passwd.hu>
2016-02-14 01:34:16 +01:00
Luca Barbato
e579d8b29c lavf: Dump the cpb side data information 2016-02-13 14:03:52 +01:00
Michael Niedermayer
a73b23e3df avformat/hlsenc: Fix filename and options
Regression since bc9a5965c8

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-10 19:14:53 +01:00
Rostislav Pehlivanov
135460383e avformat: add vc2 as an allowed rawenc Dirac extension
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2016-02-10 17:15:59 +00:00
Michael Niedermayer
21b459e4bb avformat/segment: Fix header_filename handling
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-10 17:59:58 +01:00
Derek Buitenhuis
bc9a5965c8 Merge commit '9f61abc8111c7c43f49ca012e957a108b9cc7610'
This also deprecates our old duplicated callbacks.

* commit '9f61abc8111c7c43f49ca012e957a108b9cc7610':
  lavf: allow custom IO for all files

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-02-10 14:42:41 +00:00
Michael Niedermayer
331a33d74a nut: Add PAL8 support
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-09 19:19:43 +01:00
Thierry Foucu
020b75806f lavf/mov: Extend extracting XMP in mov files using UUID Box
The UUID is based on http://www.adobe.com/devnet/xmp.html

The patch is made according to XMP SPECIFICATION PART 3 - STORAGE IN
FILES See Table 8

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-09 01:31:15 +01:00
Andreas Cadhalpun
2e6ba1993e asfdec: make sure packet_size is non-zero before seeking
This fixes infinite loops due to seeking back.

Signed-off-by: Alexandra Hájková <alexandra@khirnov.net>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2016-02-07 03:12:33 +01:00
Andreas Cadhalpun
bf50607ab7 asfdec: check for too small size in asf_read_unknown
This fixes infinite loops due to seeking back.

Signed-off-by: Alexandra Hájková <alexandra@khirnov.net>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2016-02-07 03:12:33 +01:00
Andreas Cadhalpun
e4d1621c6e asfdec: check avio_skip in asf_read_simple_index
The loop can be very long, even though the file is very short.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Alexandra Hájková <alexandra@khirnov.net>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2016-02-07 03:12:33 +01:00
Andreas Cadhalpun
a32dbf2aed asfdec: break if EOF is reached after asf_read_packet_header
asf_read_payload can unset eof_reached, so check it also before calling
that function.

This fixes infinite loops.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Alexandra Hájková <alexandra@khirnov.net>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2016-02-07 03:12:33 +01:00
Michael Niedermayer
2272ab0e84 avformat/mp3enc: Assert that the header we assembled is valid
Silences: CID1351343

The header is calculated by the code above the changed hunk, it is
thus asserted that the header is always correct.

Reviewed-by: "Ronald S. Bultje" <rsbultje@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-07 01:12:48 +01:00
Marton Balint
6d14e32555 lavf/asfenc: add support for setting packet size
This can provide a manual workaround for ticket #4230.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Marton Balint <cus@passwd.hu>
2016-02-05 21:32:14 +01:00
Marton Balint
22bbd6e8b7 lavf/asfenc: add support for storing creation time
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Marton Balint <cus@passwd.hu>
2016-02-05 21:32:14 +01:00
Marton Balint
79e4293613 lavf/asfenc: add support for storing languages
Checked compatiblity with VLC, Windows Media Player 12 and Windows Media ASF
Viewer 9 series.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Marton Balint <cus@passwd.hu>
2016-02-05 21:32:14 +01:00
Marton Balint
0464767301 lavf/asfenc: check the number of streams in header
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Marton Balint <cus@passwd.hu>
2016-02-05 21:32:14 +01:00
Marton Balint
7e6b788f7c lavf/asfenc: add AVClass to context
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Marton Balint <cus@passwd.hu>
2016-02-05 21:32:14 +01:00
Eran Kornblau
1bbfaba196 avformat/mov: dont print frma warning when format is the same
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-05 01:11:04 +01:00
Carl Eugen Hoyos
a36c737490 lavf/isom: Add more code points for H264.
Defined by the MP4 registration authority.
Fixes ticket #5217.
2016-02-04 17:40:06 +01:00
Schenk, Michael
93f4b41208 avformat/http: add crypto to default whitlist to get encrypted HLS working again
I think we missed the crypto in the default_whitelist in case of http. Otherwise encrypted HLS will fail with

[hls,applehttp @ 0x2af39c00] playlist[0] open_input [http://playertest.longtailvideo.com/adaptive/oceans_aes/oceans_aes-audio=65000-video=236000-14.ts], start_seq_no [1], cur_seq_no [14]

[hls,applehttp @ 0x2af39c00]    open_input curseqno [14] startseqno [1]

[hls,applehttp @ 0x2af39c00] HLS request for url 'http://playertest.longtailvideo.com/adaptive/oceans_aes/oceans_aes-audio=65000-video=236000-14.ts', offset 0, playlist 0

[NULL @ 0x2af3a200] KEY_AES_128 seg->key [http://playertest.longtailvideo.com/adaptive/oceans_aes/oceans.key] pls->key_url [http://playertest.longtailvideo.com/adaptive/oceans_aes/oceans.key]

[hls,applehttp @ 0x2af39c00]     open_input [KEY_AES_128]

[hls,applehttp @ 0x2af39c00]      : c->persistence [0]

[hls,applehttp @ 0x2af39c00]      : c->probing     [1]

[hls,applehttp @ 0x2af39c00]      : pls->input     [NULL]

[hls,applehttp @ 0x2af39c00]        using normal http path for URL [crypto+http://playertest.longtailvideo.com/adaptive/oceans_aes/oceans_aes-audio=65000-video=236000-14.ts]

[crypto @ 0x2aff7cc0] Protocol not on whitelist 'http,https,tls,rtp,tcp,udp!

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-03 15:57:43 +01:00
Kevin Mitchell
5120b03d69 avformat: add windows.h to SChannel SSP TLS code
This fixes building on cygwin
Fixes ticket #5036
2016-02-02 16:19:25 +01:00
Michael Niedermayer
d117b09021 avformat/tls_securetransport: Add missing include
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-02 16:14:37 +01:00
Michael Niedermayer
fe3fed0b14 Update demuxers and protocols for protocol whitelist support
Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-02 04:16:50 +01:00
Michael Niedermayer
1dba8371d9 avformat: add protocol_whitelist
Note to maintainers: update tools

Note to maintainers: set a default whitelist for your protocol
If that makes no sense then consider to set "none" and thus require the user to specify a white-list
for sub-protocols to be opened

Note, testing and checking for missing changes is needed

Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-02 03:39:34 +01:00
Sebastian Dröge
e3a125c970 Revert "do not write f2 if not interlaced"
This reverts commit 8ed82d8174.

SMPTE S377-1-2009c defines in F.4.1 that the Video Line Map should
always be an array with two 32 bit integers as elements. This is
repeated in G.2.12 with actual examples for progressive content,
where the second value would always be 0.

Additionally, the IRT MXF analyser also lists this as the only
error in the MXF output from ffmpeg: https://mxf-analyser-cloud.irt.de

Reviewed-by: Tomas Härdin <tomas.hardin@codemill.se>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-01 18:32:15 +01:00
Michael Niedermayer
af24b1c0cd Revert "avformat/hls: Require the file extension to be m3u / m3u8 for probing to succeed"
This can cause problems with urls that have arguments after the filename

This reverts commit b0c57206d5.

Reviewed-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-01 15:06:34 +01:00
Carl Eugen Hoyos
9ca5b27240 lavf/adxdec: Add Autodetection. 2016-02-01 10:51:46 +01:00
Bruce Dawson
09b3a42495 riffdec: Explicitly null-terminate array to work around VC++ bug
Due to this bug in VC++ 2015 Update 1:
https://connect.microsoft.com/VisualStudio/feedback/details/2291638

the 'key' array in ff_read_riff_info() ends up being not null
terminated which led to failures in a Chromium unit tests. Update 2
should have a fix, but until then it is important to avoid problems.
2016-02-01 10:41:56 +01:00
Timothy Gu
e5a6dcac47 wtvdec: Removed unused variable 2016-01-31 15:52:23 -08:00
popcornmix
def56677e5 wtv: Speed up wtv index creation
The index creation is O(N^2) with number of entries (typically thousands).
On a Pi this can take more than 60 seconds to execute for a recording of a few hours.

By replacing with an O(N) loop, this takes virtually zero time

Liked-by: Paul B Mahol <onemda@gmail.com>
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-01 00:40:47 +01:00
Michael Niedermayer
77864be44a avformat/format: Weight the filename extension higher if there is nearly no data after an ID3 available
Fixes Ticket5205

Based-on-patch-by: Carl Eugen Hoyos
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-30 22:25:31 +01:00
Michael Niedermayer
8619582bdf avformat/format: Replace nodat by enum
This makes the code much more readable

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-30 22:25:31 +01:00
Kieran Kunhya
3485332bf9 avcodec: Cineform HD Decoder
Decodes YUV 4:2:2 10-bit and RGB 12-bit files.
Older files with more subbands, skips, Bayer, alpha not supported.
Alpha requires addition of GBRAP12 pixel format.
2016-01-30 17:44:13 +00:00
Clément Bœsch
d3d03fd55e lavf/vqf: fix suported/supported typo 2016-01-30 13:08:37 +01:00
Thierry Foucu
9a09952695 lavf/flvdec: Allow files where the PreviousTagSize is not set according to the spec.
Some muxer use the FLV field PreviousTagSize to be the sum of tag
length. Without this change, the flv demuxer think the file is broken
and the re-sync will fail.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-29 22:30:12 +01:00
Hagen Schmidt
583a643146 mpegtsenc: Do not fail ADTS AAC muxing if the first frame is not ADTS
Fixes ticket 279.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-29 21:40:33 +01:00
Zhao Zhili
1e2c262212 libavformat/network: use defined constant in poll
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-29 21:31:47 +01:00
Michael Niedermayer
8fac0d6403 avformat/avio: free url/avio options
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-29 19:23:02 +01:00
Marton Balint
cfc040a49f lavf: bump micro version after the new segment muxer options
Signed-off-by: Marton Balint <cus@passwd.hu>
2016-01-29 01:41:09 +01:00
Marton Balint
369a6a6ed4 lavf/segment: add new option segment_clocktime_wrap_duration
This option can force the segmenter to only start a new segment if a packet
reaches the muxer within the specified duration after the segmenting clock
time, which makes it more resilient to backward local time jumps, such as leap
seconds or transition to standard time from daylight savings time.

Reviewed-by: Stefano Sabatini <stefasab@gmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2016-01-28 21:35:44 +01:00
Marton Balint
1036a1b8a3 lavf/segment: add support for specifying clock time offset
Reviewed-by: Stefano Sabatini <stefasab@gmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2016-01-28 21:35:37 +01:00
Derek Buitenhuis
e5b5676c00 Merge commit 'e4eb13ca77624401ea7cef1ed6ad8e2d13fd2063'
Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-01-27 18:32:28 +00:00
Derek Buitenhuis
949d6dd51c Merge commit '09f4822e4eaf61513b9092414450f3ae920ccd9d'
Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-01-27 18:29:21 +00:00
Derek Buitenhuis
257766a838 Merge commit '9cce011b1d2f66366f5d75a024c2a2f93dc2b589'
Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-01-27 16:57:24 +00:00
Derek Buitenhuis
895b888f16 Merge commit '521dc78366c6ea54b7b69426dab302a57231f81e'
Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-01-27 16:56:22 +00:00
Derek Buitenhuis
21f9468402 avutil: Rename FF_CEIL_COMPAT to AV_CEIL_COMPAT
Libav, for some reason, merged this as a public API function. This will
aid in future merges.

A define is left for backwards compat, just in case some person
used it, since it is in a public header.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-01-27 16:36:46 +00:00
Matt Oliver
b66ac803fa avformat/mux: Fix error when writing uncoded frames.
commit "avpacket: Deprecate av_dup_packet" broke the use
av_interleaved_write_uncoded_frame as any input uncoded frame has an
invalid packet size that will crash when av_packet_ref tries to allocate
'size' new memory. Since the packet is a temporary created within mux.c
itself it can be used directly without needing a new ref.

Signed-off-by: Matt Oliver <protogonoi@gmail.com>
2016-01-27 17:16:43 +11:00
Paul B Mahol
e9e623369d avcodec: add Ulead DV audio decoder
Fixes #1564.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2016-01-26 23:14:40 +01:00
Ivan
a0174f6729 avformat/flvenc: copyts in FLV muxer
The purpose of this patch is to preserve timestamps when using ffmpeg for publishing RTMP streams, e.g. ffmpeg -i rtmp://source/stream -f flv rtmp://target/stream.
There is a setting "copyts" for that purpose. Unfortunately it doesn't work with FLV muxer because it has its own timestamp correction which makes global setting "copyts" ineffective.

This patch removes timestamp correction in FLV muxer. This means FLV will rely on ffmpeg timestamp correction which makes it possible to use copyts.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-26 20:56:55 +01:00
Vittorio Gambaletta (VittGam)
8b02af1e6f avformat/mpegtsenc: Fix multi program so that it supports adding the same stream to multiple programs.
Signed-off-by: Vittorio Gambaletta <ffmpeg-dev@vittgam.net>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-25 19:47:16 +01:00
Vittorio Giovara
e80307140f yuv4mpegenc: Use AV_CEIL_RSHIFT where needed 2016-01-25 12:02:44 -05:00
Michael Niedermayer
cde57eee98 avformat/hls: Check that filename is not "" in probe before checking its extension
Possibly the check as a whole causes more problems than it helps, if so dont
hesitate to remove it

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-25 00:18:57 +01:00
Kieran Kunhya
2d40a09b6e avformat: Remove support for libquvi
libquvi has not been updated since 2013.
It also has a number of security issues.
2016-01-24 16:01:04 +00:00
Michael Niedermayer
a7305c780b Print the whitelists if entities are not found on them
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-24 16:52:10 +01:00
Michael Niedermayer
3130556c0e avformat: Document urls a bit
Spell-checked-by: Moritz Barsnick <barsnick@gmx.net>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-24 16:52:10 +01:00
Anton Khirnov
81306fd4bd hls: eliminate ffurl_* usage
Now all IO should go through the IO callbacks and be interceptable by
the caller.
2016-01-24 16:50:13 +01:00
Anton Khirnov
9f61abc811 lavf: allow custom IO for all files
Some (de)muxers open additional files beyond the main IO context.
Currently, they call avio_open() directly, which prevents the caller
from using custom IO for such streams.

This commit adds callbacks to AVFormatContext that default to
avio_open2()/avio_close(), but can be overridden by the caller. All
muxers and demuxers using AVIO are switched to using those callbacks
instead of calling avio_open()/avio_close() directly.

(de)muxers that use the URLProtocol layer directly instead of AVIO
remain unconverted for now. This should be fixed in later commits.
2016-01-24 16:45:32 +01:00
Michael Niedermayer
15cc98a0f3 avformat/libquvi: Set default demuxer and protocol limitations
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-23 00:12:54 +01:00
Michael Niedermayer
8e32d01432 avformat/concat: Check protocol prefix
Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-23 00:12:54 +01:00
Perette Barella
84110f4f77 libavformat/tcp.c : add send_buffer_size and recv_buffer_size options
adds two new options that may be set via the dictionary:

- send_buffer_size
- recv_buffer_size

When present, setsockopt() is used with SO_SNDBUF and SO_RCVBUF to set
socket buffer sizes.  I chose to make send and receive independent
because buffering requirements are often asymmetric.

Errors in setting the buffer size mean the socket will use its
default, so they are ignored.

There is no sanity checking on values, as the kernel/socket layers
already impose reasonable limits if asked for something crazy.

Rationale for enlarging receive buffers is to reduce susceptibility
to intermittent network delays/congestion.  I added setting the send
buffer for symmetry.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-22 15:36:30 +01:00
Piotr Bandurski
55c7e5bf7c riff: add C210 FourCC (Canopus C210) 2016-01-21 15:33:19 -05:00
Piotr Bandurski
7c4059ae1e riff: add YUYV FourCC (Drastic YUYV) 2016-01-21 15:33:19 -05:00
Derek Buitenhuis
65d29dd274 mov: Add an option to toggle dref opening
This feature is mostly only used by NLE software, and is
both of dubious value being enabled by default, and a
possible security risk.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2016-01-21 14:32:39 +01:00
Michael Niedermayer
56c182c4d7 avformat/nutenc: implement deinit()
Should prevent some leaks if header writing fails

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-21 13:16:24 +01:00
Carl Eugen Hoyos
4f9314ed58 lavf/riff: Support reading vlc's rawvideo fourccs.
Reported by Bob, no6b no6b com
2016-01-21 03:38:33 +01:00
Carl Eugen Hoyos
7158ce778f lavf/nut: Add forgotten fourccs for YUV4xxP9. 2016-01-21 03:35:49 +01:00
Michael Niedermayer
41e07390e0 avformat/avformat: Replace some references to filenames by urls
Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-21 02:57:10 +01:00
Michael Niedermayer
b750b67d13 avformat/img2dec: Use AVOpenCallback
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-20 21:21:31 +01:00
Michael Niedermayer
984d58a344 avformat/avio: Limit url option parsing to the documented cases
This feature is not know much or used much AFAIK, and it might be helpfull in
exploits.
No specific case is known where it can be used in an exploit though
subsequent commits depend on this commit though

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-20 21:21:31 +01:00
Michael Niedermayer
7ccedc1c78 avformat/img2dec: do not interpret the filename by default if a IO context has been opened
With this, user applications which use custom IO and have set a IO context will not have
their already opened IO context ignored and glob/seq being interpreted

Comments and tests from maintainers of user apps are welcome!

Liked-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-20 17:31:01 +01:00
Derek Buitenhuis
712d962a6a mov: Add an option to toggle dref opening
This feature is mostly only used by NLE software, and is
both of dubious value being enabled by default, and a
possible security risk.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-20 15:41:58 +01:00
Michael Niedermayer
b0c57206d5 avformat/hls: Require the file extension to be m3u / m3u8 for probing to succeed
If the filename isnt set by the user application then the code behaves like before

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-19 16:46:30 +01:00
Martin Storsjö
e4eb13ca77 flvdec: Add sanity checking of the last packet size
For http, this avoids spurious warnings about failed requests (e.g.
HTTP error 416 Requested Range Not Satisfiable), if the last packet
is truncated and the size read is bogus.

Signed-off-by: Martin Storsjö <martin@martin.st>
2016-01-19 14:24:35 +02:00
Michael Niedermayer
09f4822e4e flvdec: perform duration search just once
When loading a truncated flv file, it would previously try to do a seek to
the end of every packet read. For some input protocols (such as http), such
repeated seek attempts are cripple the reading performance.

Signed-off-by: Martin Storsjö <martin@martin.st>
2016-01-19 14:24:34 +02:00
Mats Peterson
d6b3062b5a lavf/qtpalette: Fix incorrect palettes
This patch corrects the colors of the 2 and 4 bpp palettes.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-19 11:18:32 +01:00
Carl Eugen Hoyos
9cf8c3e62c ape: Show more information for loglevel verbose.
Requested by Andy E, fixes bug 687.
2016-01-19 11:02:14 +01:00
Hendrik Leppkes
e816fe7401 Merge commit '7570c9e04f010c9b3bfdeb4338d330f2cdd25278'
* commit '7570c9e04f010c9b3bfdeb4338d330f2cdd25278':
  swfdec: support compressed swf

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-01-19 08:58:55 +01:00
Hendrik Leppkes
be3963c8af Merge commit '066281372d90d63ca021b659abcb8faefd6bc4a6'
* commit '066281372d90d63ca021b659abcb8faefd6bc4a6':
  asfdec: Remove unused function parameters

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-01-19 08:47:48 +01:00
Carl Eugen Hoyos
9bc281beae lavf/icodec: Improve autodetection.
Avoids misdetection of MPEG (B-)frames.

Reviewed-by: Michael Bradshaw
2016-01-18 00:36:44 +01:00
Eddie Hao
a6dc1eb837 remove all uses of the deprecated avpicture_get_size() function
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-17 12:01:35 +01:00
Mats Peterson
535d09a510 lavf/matroskadec: Get sample size from private data
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-16 11:44:46 +01:00
Mats Peterson
a51c8a68ad lavf/mov: Don't limit fourcc 0 -> raw/twos to version 0 sample descriptions
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-16 11:42:46 +01:00
Piotr Bandurski
eded2e4fac avformat/riff: add C210 FourCC (Canopus C210) 2016-01-15 19:22:51 +01:00
Piotr Bandurski
23ac355487 avformat/riff: add YUYV FourCC (Drastic YUYV) 2016-01-15 19:14:51 +01:00
Michael Niedermayer
cfda1bea4c avformat/hls: Even stricter URL checks
This fixes a null pointer dereference at least

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 15:29:22 +01:00
Michael Niedermayer
6ba42b6482 avformat/hls: More strict url checks
No case is known where these are needed

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 14:11:21 +01:00
James Almer
e3c188e72c avcodec/rmdec: add missing av_log argument
Also change the format specifier to expect an unsigned int

Signed-off-by: James Almer <jamrial@gmail.com>
2016-01-15 02:26:36 -03:00
Mats Peterson
b58cfa616c lavf/mov: Confine 0x00000000 to raw/twos fourcc mapping to version 0 sample descriptions
Confine the 0x00000000 to 'raw '/'twos' fourcc mapping to old version 0
sound sample descriptions, since they are the only valid sample
descriptions for this type of mapping.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 03:38:43 +01:00
Andreas Cadhalpun
c29e87ad55 asfdec_o: check for too small size in asf_read_unknown
This fixes infinite loops due to seeking back.

Reviewed-by: Alexandra Hájková <alexandra.khirnova@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-01-15 00:40:21 +01:00
Andreas Cadhalpun
0e32153e9c asfdec_o: break if EOF is reached after asf_read_packet_header
asf_read_payload can unset eof_reached, so check it also before calling
that function.

This fixes infinite loops.

Reviewed-by: Alexandra Hájková <alexandra.khirnova@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-01-15 00:39:46 +01:00
Andreas Cadhalpun
3776a72962 asfdec_o: make sure packet_size is non-zero before seeking
This fixes infinite loops due to seeking back.

Reviewed-by: Alexandra Hájková <alexandra.khirnova@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-01-15 00:39:30 +01:00
Andreas Cadhalpun
74474750f1 asfdec_o: prevent overflow causing seekback
This fixes infinite loops.

Reviewed-by: Alexandra Hájková <alexandra.khirnova@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-01-15 00:38:50 +01:00
Andreas Cadhalpun
0002d845e8 asfdec_o: check avio_skip in asf_read_simple_index
The loop can be very long, even though the file is very short.

Reviewed-by: Alexandra Hájková <alexandra.khirnova@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-01-15 00:37:30 +01:00
Andreas Cadhalpun
aa18016996 asfdec_o: reject size > INT64_MAX in asf_read_unknown
Both avio_skip and detect_unknown_subobject use int64_t for the size
parameter.

This fixes a segmentation fault due to infinite recursion.

Reviewed-by: Alexandra Hájková <alexandra.khirnova@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-01-15 00:37:13 +01:00
Andreas Cadhalpun
763c572801 asfdec_o: only set asf_pkt->data_size after sanity checks
Otherwise invalid values are used unchecked in the next run.
This can cause NULL pointer dereferencing.

Reviewed-by: Alexandra Hájková <alexandra.khirnova@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-01-15 00:36:41 +01:00
Michael Niedermayer
c3a24006d5 avformat/rmdec: Fix Packet memleak at close()
Fixes: asan_heap-oob_445b39_1741_d00eb645ab48eb2203b4a04a5b997103.ivr

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-14 23:49:52 +01:00
Michael Niedermayer
80fd348bb7 avformat/rmdec: Check size in ivr_read_packet() before use
Fixes out of array access
Fixes: asan_heap-oob_445b39_1741_d00eb645ab48eb2203b4a04a5b997103.ivr

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-14 23:49:52 +01:00
Maxim Andreev
7145e80b4f avformat/hls: forbid all protocols except http(s) & file
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-14 00:18:00 +01:00
Andreas Cadhalpun
9cdddb93bb nutdec: only copy the header if it exists
Fixes runtime error: null pointer passed as argument 2, which is
declared to never be null

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-01-13 09:44:44 +01:00
Andreas Cadhalpun
5b83b24ccb nuv: sanitize negative fps rate
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-01-13 09:37:11 +01:00
Michael Niedermayer
115fb6d03e avformat/aviobuf: Fix end check in put_str16()
Fixes out of array read
Fixes: 03c406ec9530e594a074ce2979f8a1f0/asan_heap-oob_7dec26_4664_37c52495b2870a2eaac65f53958e76c1.flac

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-13 03:09:08 +01:00
Carl Eugen Hoyos
405abdbaee lavf/mpjpegdec: Do not call av_log() while probing. 2016-01-12 20:35:03 +01:00
Michael Niedermayer
7c0b84d899 avformat/asfenc: Check pts
Fixes integer overflow
Fixes: 0063df8be3aaa30dd6d76f59c8f818c8/signal_sigsegv_7b7b59_3634_bf418b6822bbfa68734411d96b667be3.mov

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-12 19:57:14 +01:00
Michael Niedermayer
d73f0c586e avformat/asfenc: Flush packet before duration becomes unrepresentable
Fixes: 0063df8be3aaa30dd6d76f59c8f818c8/signal_sigsegv_7b7b59_3634_bf418b6822bbfa68734411d96b667be3.mov
Fixes assertion failure

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-12 19:30:22 +01:00
Mats Peterson
adef8ee794 lavf/matroskadec: Use av_realloc() in get_qt_codec()
Use av_realloc() rather than av_malloc() when normalizing noncompliant
private data in get_qt_codec().

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-12 14:53:25 +01:00
Anton Khirnov
9cce011b1d movenc-test: stop setting the GLOBAL_HEADER codec flag
This test does no encoding, setting the flag was done just to silence
the warning removed in the previous commit.
2016-01-12 09:12:24 +01:00
Anton Khirnov
521dc78366 mux: drop the warning about global headers
The AVStream codec context is often not (and should not be) the actual
encoding context, so this warning will be spurious in many cases.
2016-01-12 09:12:24 +01:00
Ricardo Constantino
d50b5d547f rtmpdh: Initialize gcrypt before using it
Either disabling or init'ing secure memory is required after the use
of gcry_check_version. From a look at the functions rtmpdh uses, I
noticed none require the use of secure memory, so we disable it [1][2].

This resolves some errors returned by rtmpdh code with uninitialized
gcrypt, especifically:
Fatal: failed to create the RNG lock: Invalid argument
FATAL: failed to acquire the FSM lock in libgrypt: Invalid argument

Version "1.5.4" was arbitrarily chosen. An older version probably works
as well, but I couldn't compile older versions to test on my machine.

[1]
https://gnupg.org/documentation/manuals/gcrypt/Initializing-the-library.html
[2]
https://www.gnupg.org/documentation/manuals/gcrypt/Controlling-the-library.html

Signed-off-by: Ricardo Constantino <wiiaboo@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-12 00:56:02 +01:00
Andreas Cadhalpun
f6e1c96730 ffmdec: change type of len to ptrdiff_t
It is used to store the difference between pointers, so ptrdiff_t is the
correct type.

This prevents potential overflows.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-01-11 23:14:52 +01:00
Andreas Cadhalpun
63c9b30f98 qtpalette: make the color_* variables unsigned again
This fixes segmentation faults due to out of bounds writes, when
color_start is interpreted as negative number.

This regression was introduced in commit 57631f.

Reviewed-by: Mats Peterson <matsp888@yahoo.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-01-11 23:14:52 +01:00
Clément Bœsch
7570c9e04f swfdec: support compressed swf
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-01-11 15:32:56 -05:00
Alexandra Hájková
34d45b3616 asfdec: Fix typo in comment
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2016-01-11 21:00:49 +01:00
Michael Niedermayer
c71999ef97 avformat/dfa: Fix packet leak on error
Fixes: 07fa81f300736485e585b63e7b1cd155/signal_sigabrt_7ffff6ae7cb7_16_94ee815791a1357826524072db5bc2dc.dfa

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-11 17:16:18 +01:00
Mats Peterson
71f73ee325 lavf/matroskadec: Normalize noncompliant A_QUICKTIME/V_QUICKTIME private data
This patch adds a new static function get_qt_codec() that takes care of
the initial retrieval of the fourcc and codec ID for A_QUICKTIME and
V_QUICKTIME. It also normalizes noncompliant private data found in some
older files that incorrectly starts with the fourcc by expanding/shifting
the data by 4 bytes, and storing the data size at the start. This is
necessary in order for the rest of the code in the A_QUICKTIME and
V_QUICKTIME blocks (and most likely other code as well) to correctly
parse the private data.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-11 01:35:34 +01:00
Marton Balint
fdb2d4b108 lavf/concatdec: do not access packet if av_read_frame returned error
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Marton Balint <cus@passwd.hu>
2016-01-10 14:13:16 +01:00
Michael Niedermayer
2039b3e751 avformat: Add integer fps from 31 to 60 to get_std_framerate()
Fixes Ticket 5106

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-09 15:21:34 +01:00
Michael Niedermayer
6e249466cc avformat/movenc: Check that pkt duration is within 32bit range
Durations outside are not supported

Fixes Ticket5114
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-09 03:38:03 +01:00
Michael Niedermayer
5c8467a07c avformat/ivfenc: fix division by zero
Fixes Ticket 5115

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-08 23:27:10 +01:00
Michael Niedermayer
47cd85e1e5 avformat/mov: Simplify format checking code
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-08 14:52:53 +01:00
Mats Peterson
6f1466dc52 lavf/matroskadec: A_QUICKTIME and fourcc 0x00000000
In many older QuickTime files, the audio format, or "fourcc", is
0x00000000. The QuickTime File Format Specification states the following
regarding this situation:

"This format descriptor should not be used, but may be found in some
files. Samples are assumed to be stored in either 'raw ' or 'twos'
format, depending on the sample size field in the sound description."

MPlayer handles this logic by itself, but FFmpeg/FFplay currently does
not.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-08 14:52:53 +01:00
Mats Peterson
13d02d3dc8 lavf/mov: Audio and fourcc 0x00000000
In many older QuickTime files, the audio format, or "fourcc", is
0x00000000. The QuickTime File Format Specification states the following
regarding this situation:

"This format descriptor should not be used, but may be found in some
files. Samples are assumed to be stored in either 'raw ' or 'twos'
format, depending on the sample size field in the sound description."

MPlayer handles this logic by itself, but FFmpeg/FFplay currently does
not.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-08 14:52:53 +01:00
Clément Bœsch
5fbe57c027 lavf/uncodedframecrcenc: use FF_CEIL_RSHIFT() 2016-01-07 22:28:08 +01:00
Alexandra Hájková
066281372d asfdec: Remove unused function parameters
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-01-07 08:20:21 +01:00
Andreas Cadhalpun
2aec600ae7 asfdec: reject size > INT64_MAX in asf_read_unknown
Both avio_skip and detect_unknown_subobject use int64_t for the size
parameter.

This fixes a segmentation fault due to infinite recursion.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Alexandra Hájková <alexandra.khirnova@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-01-07 08:20:21 +01:00
Andreas Cadhalpun
c69461d737 asfdec: only set asf_pkt->data_size after sanity checks
Otherwise invalid values are used unchecked in the next run.
This can cause NULL pointer dereferencing.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Alexandra Hájková <alexandra.khirnova@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-01-07 08:20:21 +01:00
Mats Peterson
6a975cb07f lavf/matroskadec: correct codec_tag for "SMI" SVQ3 files
This corrects the codec_tag for some SVQ3 files

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-06 14:45:52 +01:00
Carl Eugen Hoyos
c3c22bee63 lavf/matroskaenc: Assume 48kHz sample rate for Opus initial padding.
Analyzed by Timothy B. Terriberry in Mozilla bug 1227153.
Fixes ticket #5121.
2016-01-05 21:34:35 +01:00
Andreas Cadhalpun
1cb2331eca brstm: fix missing closing brace
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-01-04 13:44:16 +01:00
Andreas Cadhalpun
bcf4ee26a0 brstm: also allocate b->table in read_packet
This fixes NULL pointer dereferencing if the codec is forced to
adpcm_thp even though a different one was detected.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-01-04 13:20:09 +01:00
Andreas Cadhalpun
d7d37c479f brstm: make sure an ADPC chunk was read for adpcm_thp
This fixes NULL pointer dereferencing.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-01-04 13:19:59 +01:00
Mats Peterson
b6c61b7d43 lavf/qtpalette: Ignore greyscale bit in certain cases
The QuickTime File Format Specification states the following:

"Depth: A 16-bit integer that indicates the pixel depth of the
compressed image. Values of 1, 2, 4, 8 ,16, 24, and 32 indicate the
depth of color images. The value 32 should be used only if the image
contains an alpha channel. Values of 34, 36, and 40 indicate 2-, 4-, and
8-bit grayscale, respectively, for grayscale images."

There is no mention of value 33, i.e. 1-bit video (0x01) with the
greyscale bit (0x20) set. I therefore suggest that we ignore the
greyscale bit when processing 1-bit video. Another reason to do this is
that the first 1-bit sample file below will be displayed properly with
blue colors in QuickTime in Windows or Mac *in spite of* the greyscale
bit being set.

Also, QuickTime in Windows or Mac ignores the greyscale bit if the
video sample description contains a palette, regardless of bit depth.
This is undocumented behaviour, but I think we should do the same, and
it seems pretty logical after all, since one wouldn't really bother
putting a customized palette into a grayscale file anyway. See the
second 8-bit sample file below, which has the greyscale bit set, and
which contains a palette in the video sample description. In Windows or
Mac, it will be displayed with the palette in the sample description, in
spite of the greyscale bit being set.

Sample file 1 (1-bit QuickTime Animation):
https://drive.google.com/open?id=0B3_pEBoLs0faTThSek1EeXQ0ZHM
Earth Spin 1-bit qtrle orig.mov

Sample file 2 (8-bit QuickTime Animation):
https://drive.google.com/open?id=0B3_pEBoLs0fad2s0V1YzUWo5aDA
quiz-palette+gs.mov

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-04 03:31:49 +01:00
Andreas Cadhalpun
40eb2531b2 ffmdec: reset packet_end in case of failure
This fixes segmentation faults caused by passing a packet_ptr of NULL to
memcpy.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-01-03 21:13:01 +01:00
Michael Niedermayer
97c162add7 avformat/ffmdec: Add {} to nested if/else
This preempts potential bugs if this is changed and the indention
ends up different from C interpretation

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-03 16:08:32 +01:00
Andreas Cadhalpun
2e752c7de9 ffmdec: change type of state and id to unsigned
This fixes ubsan runtime error: left shift by 8 places cannot be
represented in type 'int'

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-01-02 20:03:57 +01:00
Hendrik Leppkes
95a2b883e3 Merge commit '69a68593ce5684409c3c4dd9a901bfd8b16925b1'
* commit '69a68593ce5684409c3c4dd9a901bfd8b16925b1':
  Remove stray line breaks from avpriv_{report_missing_feature|request_samples}

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-01-02 13:20:13 +01:00
Hendrik Leppkes
8a04ddeb47 Merge commit '5049f6b772891cdf4030a9d572362efc8f7ae97f'
* commit '5049f6b772891cdf4030a9d572362efc8f7ae97f':
  rtpdec_jpeg: Coalesce redundant error checks

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-01-02 13:19:23 +01:00
Andreas Cadhalpun
c112be25f7 oggparsedaala: reject too large gpshift
Also use a unsigned constant for the shift calculation, as 1 << 31 is
undefined for int32_t. This is also fixed oggparsetheora.

This fixes ubsan runtime error: shift exponent is too large for
32-bit type 'int'

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-01-02 12:00:39 +01:00
Hendrik Leppkes
b966a403dd avcodec/utils: fix AVPacket lifetime in seek_frame_generic
Fixes ticket #5117
2016-01-02 09:27:51 +01:00
Michael Niedermayer
dbfb2c1abf avformat/mp3dec: Remove unused variable
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-01 21:21:10 +01:00
Clément Bœsch
77eeaa2c3d lavf/srtdec: rewrite parsing logic
Fixes Ticket #5032

The samples in Ticket #5032 is using \r\r\n as line breaks.  Since we
already are handling \r, or \n, or \r\n as line breaks, \r\n\n will be
considered as a double line breaks. This is an issue because
ff_subtitles_read_text_chunk() will as a result stop extracting a chunk
after just one line.

So instead of parsing the SRT by "chunks" (which means splitting every
double LB), this new parser is detecting timing lines, and split the
events on this basis. While this sounds safe and simple, it needs to
take into account the event number preceding the timing line while
handling situations such as:

 - event number starting at 0 or actually any number instead of 1
 - event numbers not being ordered at all
 - event number being followed by text garbage (this really happened,
   see Ticket #4898)
 - event payload containing one or multiple number (a protagonist saying
   a count-down, a date or whatever) which could be confused with a
   chapter number
 - event number being empty (see Ticket #2167)
 - all kind of weird line breaks can appear randomly like wild pokémons
 - untrustable line breaks (Ticket #5032)

The sample madness.srt tries to sum up most of this into one sample,
ticket5032-rrn.srt is the file containing \r\r\n line breaks. and
empty-events-2167.srt contains empty events.
2016-01-01 18:31:49 +01:00
Hendrik Leppkes
99f2a56388 Merge commit '64f8c439fd663fec4d57ac21af572d498fe21f7a'
* commit '64f8c439fd663fec4d57ac21af572d498fe21f7a':
  rtmpproto: Include the full path as app when "slist=" is found

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-01-01 17:21:32 +01:00
Hendrik Leppkes
5c06fc4bd8 Merge commit '2d0432d918a71468419b7ac1e543ab3b399d3d37'
* commit '2d0432d918a71468419b7ac1e543ab3b399d3d37':
  vocdec: put the code not shared with other demuxers under appropriate ifdef

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-01-01 17:14:46 +01:00
Michael Niedermayer
0b1e94c50a Revert "Merge commit '9f1eccb97bf8894cb18b14f642500686505ef186'"
This unbreaks muxing-encoding
Example:
ffmpeg -i matrixbench_mpeg2.mpg new.avi

-rw-r----- 1 michael michael 226035354 Jan  1 16:27 new.avi
-rw-r----- 1 michael michael  10016802 Jan  1 16:28 ref.avi

Also av_get_audio_frame_duration() itself uses frame_size

This reverts commit 29e6606e9b, reversing
changes made to 53448461a7.
2016-01-01 17:05:46 +01:00
Hendrik Leppkes
a78d9abee0 Merge commit '72d658766e6ccf198317dffd6499c5e288847a1c'
* commit '72d658766e6ccf198317dffd6499c5e288847a1c':
  mp3dec: replace avpriv_mpa_decode_header with avpriv_mpegaudio_decode_header

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-01-01 16:57:40 +01:00
Hendrik Leppkes
1e96b151fa Merge commit '955aec3c7c7be39b659197e1ec379a09f2b7c41c'
* commit '955aec3c7c7be39b659197e1ec379a09f2b7c41c':
  mpegaudiodecheader: check the header in avpriv_mpegaudio_decode_header

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-01-01 16:47:27 +01:00
Hendrik Leppkes
f6728a3ea2 Merge commit '6bf4c1d71199b92894f24db6386ed5070e590a16'
* commit '6bf4c1d71199b92894f24db6386ed5070e590a16':
  r3d: do not create the audio stream until we know the sample rate

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-01-01 15:59:30 +01:00
Hendrik Leppkes
29e6606e9b Merge commit '9f1eccb97bf8894cb18b14f642500686505ef186'
* commit '9f1eccb97bf8894cb18b14f642500686505ef186':
  ff_parse_specific_params: do not use AVCodecContext.frame_size

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-01-01 15:52:18 +01:00
Hendrik Leppkes
53448461a7 Merge commit '1f008f34d5b2b5f6217521747e7acfe3efc0e666'
* commit '1f008f34d5b2b5f6217521747e7acfe3efc0e666':
  rmenc: do not use AVCodecContext.frame_size

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-01-01 15:51:58 +01:00
erankor
3f8564fe3c avformat/mov: support cenc (common encryption)
support reading encrypted mp4 using aes-ctr, conforming to ISO/IEC
23001-7.

a new parameter was added:
- decryption_key - 128 bit decryption key (hex)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-31 16:46:36 +01:00
Michael Niedermayer
389ce22b5f avformat/movenc: Use strict_std_compliance from the muxer layer instead of the encoder layer
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-12-30 20:06:04 +01:00
Andreas Cadhalpun
b4466c9c1a oggparsedaala: check number of planes in pixel format map
This fixes crashes caused by out-of-bounds writes.

Reviewed-by: Rostislav Pehlivanov <atomnuker@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-12-29 18:42:14 +01:00
Mats Peterson
bd03ee1184 lavf/qtpalette: Treat 1-bit video as palettized
This commit for qtpalette.c and qtpalette.h adds 1-bit video to the
"palettized video" category, since if the video sample description
contains a palette, the two colors in the palette can be any color, not
necessarily black & white.

Unfortunately, I've noticed that the qtrle (QuickTime Animation) decoder
blindly assumes that 1-bit video is black & white. I don't have enough
knowledge about the decoder to fix this, though.

Below is a link to a sample 1-bit QuickTime Animation clip of a rotating
earth that uses blueish colors, and they will be correctly rendered in
QuickTime, but not in FFmpeg (which will use black & white).

https://drive.google.com/open?id=0B3_pEBoLs0faUlItWm9KaGJSTEE

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-29 13:12:18 +01:00
Rodger Combs
1b5bd4051d lavf/mpegtsenc: add automatic bitstream filtering 2015-12-28 08:40:37 -06:00
Rodger Combs
b287d7ea17 lavf/matroskaenc: add automatic bitstream filtering 2015-12-28 08:40:37 -06:00
Rodger Combs
822e80fde3 lavf: add internal API to append a bsf to a stream's list 2015-12-28 08:40:37 -06:00
Rodger Combs
1f9139b07b lavf: add automatic bitstream filtering; bump version
This solves the problem discussed in https://ffmpeg.org/pipermail/ffmpeg-devel/2015-September/179238.html
by allowing AVCodec::write_header to be delayed until after packets have been
run through required bitstream filters in order to generate global extradata.

It also provides a mechanism by which a muxer can add a bitstream filter to a
stream automatically, rather than prompting the user to do so.
2015-12-28 08:40:35 -06:00
Rodger Combs
7a161b74ad lavf/tee: use lavf API for applying bitstream filters 2015-12-28 08:37:39 -06:00
Rodger Combs
4caa3e1c6c lavf: add API to apply a list of bsfs to a packet 2015-12-28 08:34:30 -06:00
Michael Niedermayer
ca9e3cb3ce avformat/qtpalette: Move ff_get_qtpalette() doxy to header
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-28 03:18:20 +01:00
Mats Peterson
7973603843 avformat/matroskadec: palettized QuickTime video in Matroska
Palettized QuickTime video in Matroska has hitherto not been recognized
whatsoever, and the "palette" used has been completely random.

The patch for matroskadec.c fixes this issue by adding a palette side
data packet in matroska_deliver_packet(), much in the same way as it's
done in mov.c.

Video samples for testing are available at
https://drive.google.com/open?id=0B3_pEBoLs0faWElmM2FnLTZYNlk.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-28 02:47:58 +01:00
Mats Peterson
57631f1851 avformat: factor ff_get_qtpalette() out of mov.c
This consists mainly of moving the palette handling from
the mov_parse_stsd_video() function to a new ff_get_qtpalette() function
in the new file qtpalette.c, which will be shared by both matroskadec.c and
mov.c.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-28 02:47:26 +01:00
Joel Holdsworth
c48122d731 avformat/hls: Added http_proxy support
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-27 21:44:15 +01:00
Joel Holdsworth
9cdccd404b avformat/hls: Remember to free HLSContext::headers
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-27 21:44:15 +01:00
Joel Holdsworth
b4eb1f29eb avformat/http: Added http_proxy option
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-27 21:44:14 +01:00
Reynaldo H. Verdejo Pinochet
baf4c489e5 avio: add detail to avio_printf() size warning
Previous "currently size is limited" didn't give away
much in terms of useful info.

Signed-off-by: Reynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>
2015-12-27 00:09:16 -08:00
Michael Niedermayer
e70d56b8ad avformat/img2dec: Reuse main IO context instead of reopening a single file
Fixes part of Ticket4849

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-26 20:21:52 +01:00