1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-03 05:10:03 +02:00
Commit Graph

75270 Commits

Author SHA1 Message Date
Michael Niedermayer
9fefd76eec avcodec/flac_parser: Raise threshold for detecting invalid data
Fixes regression from Ticket5428

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit b0b3676e13)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-15 18:54:34 +02:00
Michael Niedermayer
087bd8fbdf avfilter/vf_telecine: Make frame writable before writing into it
Fixes Ticket 5627

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit fa0097e008)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-15 18:54:34 +02:00
Michael Niedermayer
40ffbe7678 avcodec/mpc8: Correct end truncation
Fixes Ticket5478

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit b21f674876)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-15 18:54:34 +02:00
Michael Niedermayer
ed7fe48445 avcodec/mpegvideo: Do not clear the parse context during init
It is allocated before, this cannot work
Fixes Ticket5613

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 24f5136196)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-15 18:54:34 +02:00
Michael Niedermayer
d9ad05abce MAINTAINERs cleanup (remove myself from things i de facto dont maintain)
x86 is maintained entirely by others these days
ML, mostly too

remove myself from a few spots that have other maintainers and where i
just dont know the code that well anyway to do an ideal job

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit bb5bc08ba6)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-15 18:54:34 +02:00
Michael Niedermayer
bfca58ee2f avcodec/h264: Fix off by 1 context count
Fixes fate-h264-xavc-4389 with slice threads
(cherry picked from commit 27c1eae55f)

Conflicts:

	libavcodec/h264.c

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-15 18:54:34 +02:00
Michael Niedermayer
8a32f19d5b avcodec/alsdec: Check r to prevent out of array read
No testcase known

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit c36fc857b5)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-15 18:54:34 +02:00
Umair Khan
1dd34bdb09 avcodec/alsdec: fix max bits in ltp prefix code
The maximum number of bits int the prefix code for
p(0) is 4. By setting it as 3, we were missing the
last 0 bit.
This fixes bug #4715 present on the trac.

Signed-off-by: Umair Khan <omerjerk@gmail.com>
Reviewed-by: Thilo Borgmann <thilo.borgmann@mail.de>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 5d64ba9d18)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-15 18:54:34 +02:00
Michael Niedermayer
04987035ff avcodec/utils: check skip_samples signedness
Fixes Ticket5528

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 153ab83bd3)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-15 18:54:34 +02:00
Michael Niedermayer
a4484854db avformat/mpegts: Do not trust BSSD descriptor, it is sometimes not an S302M stream
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit a5eb70ad95)

Conflicts:

	libavformat/mpegts.c
2016-08-15 18:54:34 +02:00
Michael Niedermayer
003fa5c3e3 avcodec/bmp_parser: Check fsize
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 43a4276c69)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-15 18:54:34 +02:00
Michael Niedermayer
166921c23e avcodec/bmp_parser: reset state
Fixes part of ticket 5598

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 37005e65eb)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-15 18:54:34 +02:00
Michael Niedermayer
591c0b527c avcodec/bmp_parser: Fix remaining size
Fixes part of ticket 5598

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 250b620d29)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-15 18:54:34 +02:00
Michael Niedermayer
731848ef80 avcodec/bmp_parser: Fix frame_start_found in cross frame cases
Fixes part of ticket 5598

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit bfe945ac3a)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-15 18:54:34 +02:00
Michael Niedermayer
76fd8145a1 avfilter/af_amix: dont fail if there are no samples in output_frame()
Fixes Ticket5326

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit abc957e896)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-15 18:54:34 +02:00
Vivekanand
5af0ada442 avformat/allformats: Making av_register_all() thread-safe.
When multiple threads tries to call av_register_all(), the first thread sets
initialized to 1 and do the register process. At the same time, other thread might
also call av_register_all(), which returns immediately because initialized is set to 1
(even when it has not completed registering codecs). We can avoid this problem
if we set initialised to 1 while exiting from function.

Github: Closes #196
(cherry picked from commit b092ee701f)

Conflicts:

	libavformat/allformats.c
2016-08-15 18:54:34 +02:00
Michael Niedermayer
ffb503c9a1 avcodec/mpegvideo: Deallocate last/next picture earlier
Fixes regression with mplayers direct rendering and reduces buffer count
pressure in some cases

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 39c0b22df4)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-15 18:54:34 +02:00
Michael Niedermayer
2bbbd3e50a avcodec/bmp_parser: Fix state
Fixes Ticket5598

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit d0388bd32e)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-15 18:54:34 +02:00
Thomas Guilbert
669fc1338f avformat/oggparseopus: Fix Undefined behavior in oggparseopus.c and libavformat/utils.c
Fixes: usan_granule_overflow

constant type fix by commiter
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 1a82d2cf8f)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-15 18:54:34 +02:00
Michael Niedermayer
9fe1012910 doc/developer.texi: Add a code of conduct
See: [FFmpeg-devel] [Vote] Code of Conduct

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 89e9393022)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-15 18:54:34 +02:00
Michael Niedermayer
90b27febc6 avformat/avidec: Detect index with too short entries
Fixes Ticket5498

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit d08f2c172f)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-15 18:54:34 +02:00
Chris Cunningham
c1c6cb21b7 avformat/utils: Check negative bps before shifting in ff_get_pcm_codec_id()
Fixes: undefined shift.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 2875745d35)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-15 18:54:34 +02:00
Michael Niedermayer
2e0af764b3 avformat/utils: Do not compute the bitrate from duration == 0
Fixes division by 0 in fate-acodec-ra144

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 635b2ec5f2)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-15 18:54:34 +02:00
Michael Niedermayer
8857dc6cd8 ffmpeg: Check that r_frame_rate is set before attempting to use it
Avoids unexpected occurance and dependency on NaN behavior and divisions by 0

Testcase: fate-lavf-fate-avi_cram

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 6085d6b2ae)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-15 18:54:34 +02:00
Michael Niedermayer
67c7f8ca14 swresample/rematrix: Use clipping s16 rematrixing if overflows are possible
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 2f76157eb0)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-15 18:54:34 +02:00
Michael Niedermayer
500cf2e159 swresample/rematrix: Use error diffusion to avoid error in the DC component of the matrix
This fixes the sum of the integer coefficients ending up summing to a value
larger than the value representing unity.

This issue occurs with qN0.dts when converting to stereo

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 7fe81bc4f8)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-15 18:54:34 +02:00
Chris Cunningham
345231336f libavformat/oggdec: Free stream private when header parsing fails.
Leaking this private structure opens up the possibility that it may
be re-used when parsing later packets in the stream. This is
problematic if the later packets are not the same codec type (e.g.
private allocated during Vorbis parsing, but later packets are Opus
and the private is assumed to be the oggopus_private type in
opus_header()).

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 542f725964)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-15 18:54:34 +02:00
Michael Niedermayer
fc6f314838 avformat/utils: Check bps before using it in a shift in ff_get_pcm_codec_id()
Fixes undefined shift
Fixes: usan_shift

Found-by: Thomas Guilbert <tguilbert@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit ea791c080d)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-15 18:54:34 +02:00
Michael Niedermayer
3bbef6082a avformat/oggparseopus: Check that granule pos is within the supported range
Larger values would imply file durations of astronomic proportions and cause
overflows

Fixes integer overflow
Fixes: usan_int64_overflow

Found-by: Thomas Guilbert <tguilbert@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 8efaee3710)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-15 18:54:34 +02:00
Michael Niedermayer
0aaf66fb2e avcodec/mjpegdec: Do not try to detect last scan but apply idct after all scans for progressive jpeg
Fixes: IMG-20160418-WA0002.jpg

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit deaf58abf2)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-15 18:54:34 +02:00
Michael Niedermayer
330f4ef48c avformat/options_table: Add missing identifier for very strict compliance
Fixes Ticket5443

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 11db7eee9b)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-15 18:54:34 +02:00
Luca Barbato
8887dafda1 librtmp: Avoid an infiniloop setting connection arguments
The exit condition was missing.

Signed-off-by: Timothy Gu <timothygu99@gmail.com>
(cherry picked from commit e85d38c20a)
Signed-off-by: Timothy Gu <timothygu99@gmail.com>
2016-07-26 12:08:58 -07:00
James Almer
e9b7ae08d6 avformat/oggparsevp8: fix pts calculation on pages ending with an invisible frame
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 5adfbd3918)
2016-07-25 09:59:54 -03:00
Michael Niedermayer
da4ea97161 Changelog: update
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-04-29 13:27:40 +02:00
Michael Niedermayer
4e4afe29b9 avcodec/motion_est: Attempt to fix "short data segment overflowed" on IA64
This decreases the MV related encoding table sizes
This should have little effect on real world video encoding performance

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit d7c75a5db0)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-04-29 13:04:17 +02:00
Michael Niedermayer
2a15860227 avformat/ffmdec: Check pix_fmt
Fixes crash
Fixes Ticket5412

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 78baa450d9)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-04-28 23:26:45 +02:00
Michael Niedermayer
66443b0cf3 update for 2.8.7 2016-04-27 05:43:39 +02:00
Michael Niedermayer
58a7500492 avcodec/ttaenc: Reallocate packet if its too small
Fixes assertion failure
Fixes Ticket5394

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 005c61c6b8)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-04-27 04:40:12 +02:00
Jan Ekström
3003277103 pgssubdec: fix subpicture output colorspace and range
Functionality used before didn't widen the values from limited to
full range. Additionally, now the decoder uses BT.709 where it
should be used according to the video resolution.

Default for not yet set colorimetry is BT.709 due to most observed
HDMV content being HD.

BT.709 coefficients were gathered from the first two parts of BT.709
to BT.2020 conversion guide in ARIB STD-B62 (Pt. 1, Chapter 6.2.2).
They were additionally confirmed by manually calculating values.

Fixes #4637
(cherry picked from commit 9779b62624)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-04-27 04:40:12 +02:00
Michael Niedermayer
05b33258e3 avcodec/ac3dec: Reset SPX when switching from EAC3 to AC3
Fixes Ticket5319

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 9ac154d1fa)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-04-27 04:40:12 +02:00
Michael Niedermayer
c6e3682a0c avfilter/vf_drawtext: Check return code of load_glyph()
Fixes segfault
Fixes Ticket5347

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 2e67a99fbc)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-04-27 04:40:12 +02:00
Paul B Mahol
e80a4ce69f avcodec/takdec: add code that got somehow lost in process of REing
Signed-off-by: Paul B Mahol <onemda@gmail.com>
(cherry picked from commit 38797a8033)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-04-27 04:40:12 +02:00
Paul B Mahol
edc61e3aba avcodec/apedec: fix decoding of stereo files with one channel full of silence
Signed-off-by: Paul B Mahol <onemda@gmail.com>
(cherry picked from commit 9149e9c0ba)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-04-27 04:40:12 +02:00
Michael Niedermayer
5127cb2e78 avcodec/avpacket: Fix off by 5 error
Fixes out of array read
Fixes: mozilla bug 1266129
Found-by: Tyson Smith
Tested-by: Tyson Smith
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 9f36ea57ae)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-04-27 04:40:12 +02:00
Ivan
70b3e170f9 avcodec/h264: Fix for H.264 configuration parsing
Sometimes video fails to decode if H.264 configuration changes mid stream.
The reason is that configuration parser assumes that nal_ref_idc is equal to 11b
while actually some codecs but 01b there. The H.264 spec is somewhat
vague about this but it looks like it allows any non-zero nal_ref_idc for sps/pps.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 3a727606c4)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-04-27 04:40:12 +02:00
Michael Niedermayer
4e174d95f5 avcodec/bmp_parser: Ensure remaining_size is not too small in startcode packet crossing corner case
Fixes Ticket 5438

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 8e26bdd59b)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-04-27 04:40:11 +02:00
Marios Titas
21fb4d1282 avfilter/src_movie: fix how we check for overflows with seek_point
Currently, if the movie source filter is used and a seek_point is
specified on a file that has a negative start time, ffmpeg will fail.

An easy way to reproduce this is as follows:
$ ffmpeg -vsync passthrough -filter_complex 'color=d=10,setpts=PTS-1/TB' test.mp4
$ ffmpeg -filter_complex 'movie=filename=test.mp4:seek_point=2' -f null -

The problem is caused by checking for int64_t overflow the wrong way.
In general, to check whether a + b overflows, it is not enough to do:
    a > INT64_MAX - b
because b might be negative; the correct way is:
    b > 0 && > a > INT64_MAX - b

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit c1f9734f97)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-04-27 04:40:11 +02:00
Aaron Boxer
b5d4b1731e avcodec/j2kenc: Add attribution to OpenJPEG project:
http://ghostscript.com/~tor/gs-browse/gs/openjpeg/libopenjpeg/t1.c

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit b6b4b0a65e)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-04-27 04:40:11 +02:00
Michael Niedermayer
ef54c14425 avcodec/h264_slice: Check PPS more extensively when its not copied
Fixes Ticket5371
Fixes null pointer dereference

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit c50be7a52b)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-04-27 04:40:11 +02:00
Michael Niedermayer
a35e6ec1bd avcodec/libutvideodec: copy frame so it has reference counters when refcounted_frames is set
Reviewed-by: maintainer
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 0cd9ff4e3a)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-04-27 04:40:11 +02:00