Commit Graph

18606 Commits

Author SHA1 Message Date
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
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
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
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
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
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