1
mirror of https://git.videolan.org/git/ffmpeg.git synced 2024-07-13 08:00:49 +02:00
Commit Graph

18283 Commits

Author SHA1 Message Date
Bryan Huh
72f9a6349c avformat/cache: Avoid int-overflow in cache compare function
cache protocol indexes its cache using AVTreeNodes which require a cmp
function for inserting and searching new cache-entries. This cmp
function expects a 32-bit int return value (negative, zero, or positive)
but the cache cmp function returns an int64_t which can overflow the
int, giving negative numbers for when it should be positive, vice versa.
This manifests itself only for very large files (e.g. 4GB+)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-09 19:25:05 +01:00
Paul B Mahol
0cfd4a993f avformat/rsd: add XMA support
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2015-11-09 10:41:38 +01:00
Michael Niedermayer
183720eb6e avformat/segafilm: Only add index entries when the stream exists
Fixes null pointer dereference
Fixes: cb02dfb163ac833c04cace3d7e35b160/signal_sigsegv_e55c49_6326_8f25619fc86a00b303c57b7778baf70a.cpk

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-07 14:09:17 +01:00
Andreas Cadhalpun
db374790c7 jvdec: avoid unsigned overflow in comparison
The return type of strlen is size_t, i.e. unsigned, so if pd->buf_size
is 3, the right side overflows leading to a wrong result of the
comparison and subsequently a heap buffer overflow.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-11-07 13:13:35 +01:00
Paul B Mahol
b456ece557 XMA1 and XMA2 stereo decoders
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2015-11-06 13:45:50 +01:00
Sebastian Dröge
7d6a4797f1 mpegtsenc: Implement writing of Opus trim_start/trim_end control values
Signed-off-by: Sebastian Dröge <sebastian@centricular.com>
Reviewed-by: Kieran Kunhya <kierank@obe.tv>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-06 03:33:17 +01:00
Sebastian Dröge
01509cdf92 mpegtsenc: Add support for muxing Opus in MPEG-TS
Signed-off-by: Sebastian Dröge <sebastian@centricular.com>
Previous version reviewed-by: Kieran Kunhya <kierank@obe.tv>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-06 03:32:40 +01:00
Michael Niedermayer
79c4a338e4 avformat/xmv: Discard remainder of packet on error
Fixes infinite loop
Fixes: 9c48ae2680c5f23bca3d20ff0f325fd8/asan_generic_4c254d_1374_993f1e5967dd6f844b8d72f978ce2a6c.pss

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-06 02:24:01 +01:00
Michael Niedermayer
9b6fac11da avformat/xmv: factor return check out of if/else
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-06 02:11:01 +01:00
Michael Niedermayer
3692d859f4 avformat/mpegts: Only start probing data streams within probe_packets
Fixes assertion failure
Fixes: 4321db8ac331f5967ebfbfe80ce5eb78/signal_sigabrt_7ffff6ae7cc9_7213_0d6457b9d6897fa7c78507fa5de53510.ts

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-05 17:06:02 +01:00
Bryan Huh
d917f25658 avformat/cache: Use int64_t to avoid int overflow in cache_read
Fixes an issue where an int64_t ffurl_seek return-value was being stored
in an int (32-bit) "r" variable, leading to integer overflow when seeking
into a large file (>2GB), and ultimately a "Failed to perform internal
seek" error mesage.

To test, try running `ffprobe 'cache:http://<something>'` on a file that
is ~3GB large, whose moov atom is at the end of the file

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-04 03:59:17 +01:00
Ganesh Ajjanagadde
92e483f8ed all: use FFDIFFSIGN to resolve possible undefined behavior in comparators
FFDIFFSIGN was created explicitly for this purpose, since the common
return a - b idiom is unsafe regarding overflow on signed integers. It
optimizes to branchless code on common compilers.

FFDIFFSIGN also has the subjective benefit of being easier to read due
to lack of ternary operators.

Tested with FATE.

Things not covered by this are unsigned integers, for which overflows
are well defined, and also places where overflow is clearly impossible,
e.g an instance where the a - b was being done on 24 bit values.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Reviewed-by: Clément Bœsch <u@pkh.me>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-11-03 16:28:30 -05:00
Paul B Mahol
cb7a00da21 avformat: add acm demuxer
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2015-11-03 12:26:09 +01:00
Derek Buitenhuis
9ae73d0644 hlsenc: Only write PAT/PMT once per segment
This saves a lot of muxing overhead, especially on lower bitrate
segments.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2015-11-02 14:35:28 +00:00
Hendrik Leppkes
6b5d6c93dd Merge commit '00b62968d079e63bf22028f253ac297292436ebe'
* commit '00b62968d079e63bf22028f253ac297292436ebe':
  os_support: Don't try to return the service name as a string in getnameinfo

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-11-02 11:43:50 +01:00
Paul B Mahol
85a5cdb4fa avformat/segafilm: set video stream duration
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2015-11-02 10:53:06 +01:00
Paul B Mahol
0cb09b0511 avformat/segafilm: set audio stream duration
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2015-11-02 10:53:05 +01:00
Paul B Mahol
e6cccf9daa avformat/segafilm: implement seeking
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2015-11-02 10:53:05 +01:00
Hendrik Leppkes
55abb94b7d avformat: unref packet after storing it in internal packet queue
Fixes a memory leak when using genpts
2015-11-02 09:03:56 +01:00
Hendrik Leppkes
b64fe49371 avformat: always unref the packet after parsing
This fixes a memory leak when side-data is present.
2015-11-02 09:03:56 +01:00
Paul B Mahol
83d20a6a7e avformat/ipmovie: add context to av_log()
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2015-11-02 09:00:53 +01:00
Paul B Mahol
c293ef258c avformat/ipmovie: put video decoding_map_size into packet and use it in decoder
The size of decoding map can differ from one calculated
internally, producing artifacts while decoding video.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2015-11-02 08:44:05 +01:00
Michael Niedermayer
58346f6a29 avformat/icecast: Initialize .str based default for AV_OPT_TYPE_STRING types
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-31 22:37:53 +01:00
Michael Niedermayer
4d76e89c18 avformat/http: Initialize .str based default for AV_OPT_TYPE_STRING types
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-31 22:37:53 +01:00
Ganesh Ajjanagadde
47af5db721 all: fix enum definition for large values
ISO C restricts enumerator values to the range of int. Thus (for instance) 0x80000000
unfortunately does not work, and throws a warning with -Wpedantic on
clang 3.7.

This fixes it by using alternative expressions that result in identical
values but do not have this issue.

Tested with FATE.

Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-10-30 15:06:19 -04:00
Martin Storsjö
00b62968d0 os_support: Don't try to return the service name as a string in getnameinfo
Some systems may be lacking getservbyport; the previous ifdef wasn't
quite enough since it still assumed that struct servent was defined,
as pointed out by Clément Gregoire.

Simply remove the possibility to return non-numeric services in
getnameinfo; no caller of getnameinfo within libavformat
currently try to use getnameinfo for retrieving the port number without
NI_NUMERICSERV, and falling back on getservbyport may be non-threadsafe.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-10-30 10:03:58 +02:00
Michael Niedermayer
203dc14693 avformat/3dostr: Remove redundant ;
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-30 03:02:41 +01:00
Michael Niedermayer
a7af002b5f avformat/oggparseogm: Enable parser for mpeg4
Fixes regression with iJi.ogv

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-30 02:31:49 +01:00
Andreas Cadhalpun
41455dca60 avformat: stop exporting ffurl_read_complete, ffurl_seek and ffurl_size
They are not in public headers and not used outside of libavformat.

Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-10-29 23:48:13 +01:00
Paul B Mahol
48f0d3accc avformat: add DC STR demuxer
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2015-10-29 21:26:43 +01:00
Paul B Mahol
af3f793f60 avcodec: add ADPCM AICA decoder
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2015-10-29 21:26:43 +01:00
Paul B Mahol
e99321a3b6 avformat: add 3dostr demuxer
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2015-10-29 21:26:43 +01:00
Hendrik Leppkes
87a6f532b4 Merge commit '9b56d5c11488656254e9aed8d964ef2b7c2ff5e6'
* commit '9b56d5c11488656254e9aed8d964ef2b7c2ff5e6':
  avpacket: Deprecate av_dup_packet

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-10-29 14:16:44 +01:00
Hendrik Leppkes
54de179caa Merge commit 'd584533cf38141172e20bae5436629ee17c8ce50'
* commit 'd584533cf38141172e20bae5436629ee17c8ce50':
  avformat: Rework add_to_pktbuf

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-10-29 14:06:11 +01:00
Michael Niedermayer
232b8a5a43 avformat/img2enc: re enable atomic writes with split planes
They work now after fixing the implementation

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-28 02:29:51 +01:00
Michael Niedermayer
1b82a0052c avformat/img2enc: Fix img2enc atomic implementation to work with split planes
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-27 21:28:23 +01:00
Michael Niedermayer
9ec2b9fce1 avformat/img2enc: Disable rename&atomic writing for non file protocol and split planes
For protocols other than local files ff_rename() is not implemented
For split planes support the implementation is simply wrong

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-27 20:44:46 +01:00
Hendrik Leppkes
6255bf3d0d mpegts: Fix FATE seek test 2015-10-27 15:42:59 +01:00
Hendrik Leppkes
75c3e54d1c asfdec: fix FATE seek test 2015-10-27 15:29:12 +01:00
Hendrik Leppkes
c2f861ca42 Replace remaining occurances of av_free_packet with av_packet_unref 2015-10-27 14:35:30 +01:00
Hendrik Leppkes
7f5af80ba4 Merge commit 'ce70f28a1732c74a9cd7fec2d56178750bd6e457'
* commit 'ce70f28a1732c74a9cd7fec2d56178750bd6e457':
  avpacket: Replace av_free_packet with av_packet_unref

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-10-27 14:28:56 +01:00
Hendrik Leppkes
856b19d593 Merge commit 'a5d42043093a39636a1f4021a37dd9c612479f6f'
* commit 'a5d42043093a39636a1f4021a37dd9c612479f6f':
  avformat: Always return ref-counted AVPacket

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-10-27 14:12:27 +01:00
Hendrik Leppkes
8b3228a329 Merge commit '533a6198505edd1379e1cd722852350ae4a85acc'
* commit '533a6198505edd1379e1cd722852350ae4a85acc':
  innoHeim/Rsupport Screen Capture Codec decoder

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-10-27 13:58:44 +01:00
Paul B Mahol
a66243a201 avformat/aiff: add ADP4 DVI ADPCM support
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2015-10-27 13:41:54 +01:00
Hendrik Leppkes
b95b8e5a22 Merge commit '18f9308e6a96bbeb034ee5213a6d41e0b6c2ae74'
* commit '18f9308e6a96bbeb034ee5213a6d41e0b6c2ae74':
  mpjpeg: Cope with multipart lacking the initial CRLF

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-10-27 12:55:51 +01:00
Hendrik Leppkes
7daac50067 Merge commit '22f4d9c303ede1a240538fd105c97047db40dc86'
* commit '22f4d9c303ede1a240538fd105c97047db40dc86':
  img2enc: Make sure the images are atomically written

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-10-27 12:50:56 +01:00
Hendrik Leppkes
368e521646 Merge commit '5ea5a24eb70646a9061b85af407fcbb5dd4f89fd'
* commit '5ea5a24eb70646a9061b85af407fcbb5dd4f89fd':
  movenc: Honor flush requests with delay_moov, when some tracks lack samples

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-10-27 12:46:21 +01:00
Hendrik Leppkes
12e95d156a Merge commit 'e02dcdf6bb6835ef4b49986b85a67efcb3495a7f'
* commit 'e02dcdf6bb6835ef4b49986b85a67efcb3495a7f':
  rtsp: Allow $ as interleaved packet indicator before a complete response header

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-10-27 12:41:37 +01:00
AppChecker
8199908fdf fix: assigning instead of comparing
Signed-off-by: AppChecker <support.appc@cnpo.ru>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-27 12:11:38 +01:00
Timothy Gu
b9cd3e1add srtenc: Reindent 2015-10-26 23:24:45 -07:00