Commit Graph

10903 Commits

Author SHA1 Message Date
Anton Khirnov
9026ec8aaf matroskadec: make sure not to leave EbmlBin in an inconsistent state
If a read fails, the current code will free the data but leave the size
non-zero. Make sure the size is zeroed in such a case.

CC: libav-stable@libav.org
Bug-Id: 1001
Found-By: Kamil Frankowicz
Signed-off-by: Sean McGovern <gseanmcg@gmail.com>
2017-01-04 20:05:44 -05:00
John Stebbins
0982152c3f matroskadec: fix SRT subtitle duration
The codec id for SRT was changed and conditionals were not updated.
2016-12-24 08:33:17 -08:00
Martin Storsjö
1316446779 http: Check for negative chunk sizes
A negative chunk size is illegal and would end up used as
length for memcpy, where it would lead to memory accesses
out of bounds.

Found-by: Paul Cher <paulcher@icloud.com>

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2016-12-23 21:28:05 +02:00
Diego Biurrun
0b77a59336 Use correct printf conversion specifiers for POSIX integer types 2016-12-23 19:30:00 +01:00
Diego Biurrun
92db508307 build: Generate pkg-config files from Make and not from configure
This moves work from the configure to the Make stage where it can
be parallelized and ensures that pkgconfig files are updated when
library versions change.

Bug-Id: 449
2016-12-22 12:30:54 +01:00
Alexandra Hájková
fa64aea12e unary: Convert to the new bitstream reader 2016-12-19 12:35:05 +01:00
Anton Khirnov
46191a2da1 mov: fix a possible invalid read in mov_read_mac_string()
When the input string is too large, so the second condition in if ()
fails, the code will erroneously execute the else branch, indexing the
mac_to_unicode table with a negative index.

CC: libav-stable@libav.org
Bug-Id: 1000
Found-By: Kamil Frankowicz
2016-12-19 08:14:59 +01:00
Michael Niedermayer
a4fec9a7ea rtmppkt: Check for packet size mismatches
When receiving fragmented packets, the first packet declares the size,
and the later ones normally are small follow-on packets that don't repeat
the size and the other header fields. But technically, the later fragments
also can have a full header, declaring a different size than the previous
packet.

If the follow-on packet declares a larger size than the initial one, we
could end up writing outside of the allocation.

This fixes out of bounds writes.

Found-by: Paul Cher <paulcher@icloud.com>
Reviewed-by: Paul Cher <paulcher@icloud.com>

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2016-12-15 15:45:59 +02:00
Martin Storsjö
cdcfa97dc4 libavformat: Fix a faulty api deprecation guard in prepare_input_packet
This seems to have been added by mistake in 11de006b, by not
noticing the negation for the existing condition. This block does
not contain any code that accesses the codec field in AVStream.

This function is meant to serve as a complement to compute_pkt_fields2,
which is guarded by FF_API_COMPUTE_PKT_FIELDS2 && FF_API_LAVF_AVCTX.

Signed-off-by: Martin Storsjö <martin@martin.st>
2016-12-15 12:01:48 +02:00
Luca Barbato
3f75e5116b avio: Keep track of the amount of data written
Make avio_size() work with any write AVIOContext.
2016-12-08 15:58:28 -05:00
Diego Biurrun
f912fd767e Add missing #includes for standalone spherical-information-related headers 2016-12-08 20:12:23 +01:00
Vittorio Giovara
e90137c045 mov: Export spherical information
This implements Spherical Video V1 and V2, as described in the
spatial-media collection by Google.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-12-07 14:35:06 -05:00
Vittorio Giovara
2fb6acd9c2 lavc: Add spherical packet side data API
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-12-07 14:34:34 -05:00
Diego Biurrun
9265364bec build: Separate avisynth and avxsynth support
This simplifies the code.
2016-12-06 17:49:05 +01:00
Diego Biurrun
3794062ab1 Remove Plan 9 support
Supporting the system was a nice joke for the 9 release, but it has
run its course. Nowadays Plan 9 receives no testing and has no
practical usefulness.
2016-12-03 09:15:01 +01:00
Diego Biurrun
239d02eff3 avisynth: Cast to the right type when loading avisynth library functions
Fixes a number of related warnings.
2016-11-29 13:13:35 +01:00
Diego Biurrun
e122b12c88 build: Drop gcrypt support
GnuTLS in combination with gcrypt has been deprecated since 2010.
2016-11-25 18:46:53 +01:00
Martin Storsjö
537b5b773b rtmpdh: Do global initialization before running the test
The rtmpdh code can use crypto libraries which may require
a process global init. (gcrypt is one of the libraries
where the rtmpdh test code can fail if global init hasn't been
done, depending on gcrypt version.)

Signed-off-by: Martin Storsjö <martin@martin.st>
2016-11-24 13:59:17 +02:00
Alexandra Hájková
2dbe2aa2c2 rdt: Convert to the new bitstream reader 2016-11-24 11:22:13 +01:00
Alexandra Hájková
2cef81a87c ogg: Convert to the new bitstream reader 2016-11-24 11:22:13 +01:00
Alexandra Hájková
8d1997add6 mpegts: Convert to the new bitstream reader 2016-11-24 11:22:13 +01:00
James Almer
12ab667e21 matroska: use av_stream_add_side_data() for stereo3d side data
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-11-23 10:37:46 -05:00
James Almer
1893495e1d mov: Use av_stream_add_side_data() for displaymatrix side data
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-11-23 10:37:36 -05:00
James Almer
79ff9935ae utils: Add av_stream_add_side_data()
Functionally similar to av_packet_add_side_data(). Allows the use of an
already allocated buffer as stream side data.

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-11-23 10:36:13 -05:00
Diego Biurrun
5eef983297 ape: Restructure DEBUG ifdefs to avoid unused function parameter warnings 2016-11-22 17:28:16 +01:00
Diego Biurrun
97cd7a3dc0 rtpdec_mpeg4: const correctness for parse_fmtp_config()
libavformat/rtpdec_mpeg4.c:282:38: warning: passing argument 2 of ‘parse_fmtp_config’ discards ‘const’ qualifier from pointer target type
2016-11-21 14:54:03 +01:00
Luca Barbato
3c7fa8cbb9 hlsenc: Fix the openssl support 2016-11-18 11:18:58 +01:00
Luca Barbato
0a4b9d0ccd hlsenc: Add encryption support
Partially based on Christian Suloway <csuloway@globaleagleent.com> work.
2016-11-17 19:19:55 +01:00
Christian Suloway
d860a3cc0a crypto: Add encryption support
Signed-off-by: Christian Suloway <csuloway@globaleagleent.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2016-11-17 19:19:55 +01:00
Stephen Hutchinson
3cc3463f30 avisynth: Support pix_fmts added to AviSynth+
A number of new pix_fmts* have been added to AviSynth+:
16-bit packed RGB and RGBA
10-, 12-, 14, and 16-bit YUV 4:2:0, 4:2:2, and 4:4:4
8-, 10-, 12-, 14-, and 16-bit Planar RGB
8-, 10-, 12-, 14-, and 16-bit Planar YUVA and Planar RGBA
10-, 12-, 14-, and 16-bit GRAY variants
32-bit floating point Planar YUV(A), Planar RGB(A), and GRAY

*some of which are not currently available pix_fmts here and were
 not added to the demuxer due to this

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2016-11-17 09:44:12 +01:00
Stephen Hutchinson
aaae59700f avisynth: Simplify the pix_fmt check for the newer AviSynth API
The values don't need to be hardcoded since the correct values are
returned by avs_bits_per_pixel.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2016-11-17 09:21:24 +01:00
Marton Balint
bcefafa226 avisynth: Fix setting stream timebase
Stream timebase should be set using avpriv_set_pts_info, otherwise
avctx->pkt_timebase is not correct, leading to A/V desync.

Signed-off-by: Marton Balint <cus@passwd.hu>
Reviewed-by: Stephen Hutchinson <qyot27@gmail.com>
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2016-11-17 09:21:23 +01:00
Vittorio Giovara
d5d62ce6d6 mov: Fix identity matrix boolean logic
This prevented the code from correctly exporting the rotation matrix
which caused a few samples to be displayed wrong.
Introduced in ecd2ec69ce.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-11-16 11:17:06 -05:00
Diego Biurrun
800d91d348 Drop pointless void* casts 2016-11-13 18:44:01 +01:00
Diego Biurrun
fcbdd605b5 nut: Use correct function pointer casts instead of void*
Fixes several warnings of the type
libavformat/nut.c:207:42: warning: ISO C forbids conversion of function pointer to object pointer type [-Wpedantic]
2016-11-12 16:47:06 +01:00
James Almer
98cae966c7 matroskaenc: write updated STREAMINFO metadata for FLAC streams if available
FLAC streams originating from the FLAC encoder send updated and more
complete STREAMINFO metadata as part of the last packet, so write that
to CodecPrivate instead of the incomplete one available in extradata
during init.

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-11-10 09:15:24 +01:00
James Almer
f4bf236338 matroskaenc: fix muxing AAC streams when using aac_adtstoasc bsf
aac_adtstoasc makes the aac extradata available only after the first packet
is filtered, and as packet side data.

Assume extradata will be available as part of the first packet if
avpriv_mpeg4audio_get_config() fails the first time due to missing extradata
and reserve space for the OutputSampleRate element in the Tracks master.

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-11-10 09:01:18 +01:00
Diego Biurrun
67deba8a41 Use avpriv_report_missing_feature() where appropriate 2016-11-08 17:54:34 +01:00
Vittorio Giovara
de6e2ff3dd mov: Read multiple stsd from DV
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-11-08 11:22:29 -05:00
Vittorio Giovara
47a795727f hevc: Support extradata changes from multiple stsd
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-11-08 11:22:29 -05:00
Diego Biurrun
67351924fa Drop unreachable break and return statements 2016-11-03 20:17:12 +01:00
Diego Biurrun
f4ca8ea92a rtmpproto: Restructure zlib code to avoid unreachable code warning
libavformat\rtmpproto.c(1165) : warning C4702: unreachable code
2016-11-02 10:33:39 +01:00
Vittorio Giovara
ecd2ec69ce mov: Evaluate the movie display matrix
This matrix needs to be applied after all others have (currently only
display matrix from trak), but cannot be handled in movie box, since
streams are not allocated yet. So store it in main context, and apply
it when appropriate, that is after parsing the tkhd one.

Fate tests are updated accordingly.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-11-01 12:19:00 -04:00
Mark Thompson
218ed7250c openssl: Allow newer TLS versions than TLSv1
The use of TLSv1_*_method() disallows newer protocol versions; instead
use SSLv23_*_method() and then explicitly disable the deprecated
protocol versions which should not be supported.
2016-10-31 19:34:42 +00:00
Luca Barbato
c541a44e02 Revert "rtmpproto: Don't include a client version in the unencrypted C1 handshake"
This reverts commit 7d8d726be7.
2016-10-30 21:55:03 +01:00
Diego Biurrun
07cac07c0c dash: Use correct ISO C scanf conversion specifier 2016-10-28 13:29:52 +02:00
Diego Biurrun
3ec6f855d0 srt: Adjust signedness of sscanf format strings
Fixes several warnings from -Wformat.
2016-10-28 13:28:36 +02:00
Diego Biurrun
c454dfcff9 Use ISO C printf conversion specifiers where appropriate 2016-10-28 13:24:44 +02:00
Diego Biurrun
1263b2039e Adjust printf conversion specifiers to match variable signedness 2016-10-28 11:22:21 +02:00
Diego Biurrun
ca1e5eea0c Remove some pointless TRACE level debug code
This also kills some warnings with certain compiler options.
2016-10-27 12:54:14 +02:00