1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-13 21:28:01 +02:00
Commit Graph

78547 Commits

Author SHA1 Message Date
Chris Cunningham
069eea16d9 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-06-05 02:40:30 +02:00
Michael Niedermayer
79181b97d4 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-06-05 02:40:30 +02:00
Michael Niedermayer
46360e36d9 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-06-05 02:40:30 +02:00
Michael Niedermayer
ef2b8416d9 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-06-05 02:40:30 +02:00
Michael Niedermayer
9491f47035 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-06-05 02:40:30 +02:00
Michael Niedermayer
2fc7e5c1b5 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-06-05 02:40:30 +02:00
James Almer
68dcb46205 doc/general: update supported DCA extensions 2016-05-14 23:02:52 -03:00
James Almer
8dce66d33d avcodec/rscc: check input buffer size for deflate mode
Fixes overreads.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit b2244fa0a6)
2016-05-10 19:13:54 -03:00
foo86
08c21bcb5d avcodec/dca: fix sync word search error condition
This didn't actually check if sync word was found and always errored out
with "-err_detect explode" option enabled.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit ce2f9fdb0a)
2016-05-02 22:48:52 -03:00
Carl Eugen Hoyos
e675926a4f lavf/mpegts: Return small probe score for very short transport streams.
Fixes Debian bug 823098.

(cherry picked from commit 88a849c714)
2016-05-02 22:48:45 -03:00
Michael Niedermayer
c66f4d1ae6 Changelog: Fix minor formating inconsistency
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-04-28 03:03:39 +02:00
Michael Niedermayer
ad559492dc update for 3.0.2
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-04-28 01:40:54 +02:00
Michael Niedermayer
8d0cfa68b9 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-26 19:49:09 +02:00
Shivraj Patil
83eaaae005 configure: build fix for P5600 with mips code restructuring
Note:- backporting commit 15ef98afd1 from head

Signed-off-by: Shivraj Patil <shivraj.patil@imgtec.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-04-26 12:27:49 +02:00
Vicente Olivert Riera
a5638dbfba mips: add support for R6
Note:- backporting commit ad16eff64b from head

Understanding the mips32r6 and mips64r6 ISAs in the configure script is
not enough. In order to have full support for MIPS R6 in FFmpeg we need
to be able to build it, and for that we need to make sure we don't use
incompatible assembler code which makes the build fail. Ifdefing the
offending code is sufficient to fix the problem.

Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-04-26 12:27:39 +02:00
Jan Ekström
666754c665 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-26 02:47:09 +02:00
Michael Niedermayer
4c896d6bd4 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-25 04:27:29 +02:00
Michael Niedermayer
f2e9e4757f 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-24 12:41:09 +02:00
Michael Niedermayer
512c064cd9 avformat/mux: Check that deinit is set before calling it
Fixes null pointer dereference

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

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-04-24 12:40:58 +02:00
Paul B Mahol
7626fb6cbf 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-21 14:13:38 +02:00
Paul B Mahol
6fdd122b11 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-21 14:12:45 +02:00
Michael Niedermayer
264c9fe6aa 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-21 00:54:00 +02:00
Ivan
76573c5239 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-17 02:40:53 +02:00
Michael Niedermayer
14fdebc4ff 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-14 15:29:25 +02:00
Michael Niedermayer
325d0b64d5 avcodec/pngdec: Fix alpha detection with skip_frame
Fixes Ticket4816

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

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-04-09 01:12:32 +02:00
Michael Niedermayer
6103a8453f Changelog: Make formating consistent
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-04-04 22:45:14 +02:00
Marios Titas
47f0d80ee0 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-03 01:55:24 +02:00
Aaron Boxer
5d79566ab3 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-01 17:35:50 +02:00
Michael Niedermayer
fda00aa774 doc/Doxyfile: update for 3.0.1
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-29 04:25:48 +02:00
Michael Niedermayer
9b1b674ebe Changelog: update
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-29 04:23:42 +02:00
Michael Niedermayer
00b54d4625 avcodec/diracdec: check bitstream size related fields for overflows
Fixes segfault
Fixes Ticket5333

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

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-29 03:25:15 +02:00
Michael Niedermayer
26d29f0c3d 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-03-29 03:25:15 +02:00
James Almer
7b1e020fc5 avformat/svag: fix division by zero
Fixes ticket #5386

Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit d5a3578350)
2016-03-28 19:10:34 -03:00
Rostislav Pehlivanov
3d9ebfd272 Changelog: update for 3.0.1's vc2enc fixes
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2016-03-28 17:04:23 +01:00
Rostislav Pehlivanov
f01919b57a vc2enc: correctly zero out coefficient array padding
Credit for figuring this out goes to James Darnley.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
(cherry picked from commit 3ef10406e1)
2016-03-28 17:02:05 +01:00
Rostislav Pehlivanov
6cb5bbc660 Changelog: update for 3.0.1's aacenc optimizations
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2016-03-28 16:59:14 +01:00
Ganesh Ajjanagadde
f281cb4ea9 lavc/aacenc_utils: replace powf(x,y) by expf(logf(x), y)
This is ~2x faster for y not an integer on Haswell+GCC, and should
generally be faster due to the fact that anyway powf essentially does
this under the hood. Made an inline function in lavu/internal.h for this
purpose.

Note that there are some accuracy differences, that should generally be
negligible. In particular, FATE still passes on this platform.

Results in ~ 7% speedup in aac encoding with -march=native, Haswell+GCC.
before:
ffmpeg -i sin.flac -acodec aac -y sin_new.aac  6.05s user 0.06s system 104% cpu 5.821 total

after:
ffmpeg -i sin.flac -acodec aac -y sin_new.aac  5.67s user 0.03s system 105% cpu 5.416 total

This is also faster than an alternative approach that pulls in powf, gets rid of
the crufty NaN checks and other special cases, exploits knowledge about the intervals, etc.
This of course does not exclude smarter approaches; just suggests that
there would need to be significant work on this front of lower utility than
searches for hotspots elsewhere.

Reviewed-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: Ganesh Ajjanagadde <gajjanag@gmail.com>
(cherry picked from commit bccc81dfa0)
2016-03-28 16:57:41 +01:00
Reimar Döffinger
b176ab0556 aacenc_utils: Use temporary variable.
This ensures gcc does not create unnecessary
loads or stores and possibly even does not vectorize
the negation.
Speeds up mp3 to aac transcoding with default settings
by 10% when using "gcc (Debian 5.3.1-10) 5.3.1 20160224".

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
(cherry picked from commit b60dfae7af)
2016-03-28 16:56:27 +01:00
Reimar Döffinger
1cbe4ff2ac aacenc: avoid double in quantize_bands.
I cannot see any point whatsoever to use
double here instead of float, the results
are likely identical in all cases..
Using float allows for much more
efficient use of SIMD.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
(cherry picked from commit 0a04c2885f)
2016-03-28 16:56:11 +01:00
Ganesh Ajjanagadde
7c2576e15d lavc/aacenc_utils: replace sqrtf(Q*sqrtf(Q)) by precomputed value
It makes no sense whatsoever to do this at each function call; we
already have a table for this.

Yields a 2x improvement in find_min_book (x86-64, Haswell+GCC):
ffmpeg -i sin.flac -acodec aac -y sin.aac
find_min_book
old
    605 decicycles in find_min_book, 8388453 runs,    155 skips.9x
    606 decicycles in find_min_book,16776912 runs,    304 skips.9x
    607 decicycles in find_min_book,33553819 runs,    613 skips.2x
    607 decicycles in find_min_book,67107668 runs,   1196 skips.3x
    607 decicycles in find_min_book,134215360 runs,   2368 skips3x

new
    359 decicycles in find_min_book, 8388552 runs,     56 skips.3x
    360 decicycles in find_min_book,16777112 runs,    104 skips.1x
    361 decicycles in find_min_book,33554218 runs,    214 skips.4x
    361 decicycles in find_min_book,67108381 runs,    483 skips.5x
    361 decicycles in find_min_book,134216725 runs,   1003 skips5x

and more importantly a non-negligible speedup (~ 8%) to overall AAC encoding:
old:
ffmpeg -i sin.flac -acodec aac -strict -2 -y sin_new.aac  6.82s user 0.03s system 104% cpu 6.565 total
new:
ffmpeg -i sin.flac -acodec aac -strict -2 -y sin_old.aac  6.24s user 0.03s system 104% cpu 5.993 total

This also improves accuracy of the expression by ~ 2 ulp in some cases.

Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Reviewed-by: Rostislav Pehlivanov <atomnuker@gmail.com>
Signed-off-by: Ganesh Ajjanagadde <gajjanag@gmail.com>
(cherry picked from commit bd9c58756a)
2016-03-28 16:55:59 +01:00
Michael Niedermayer
526c7b2186 Update for 3.0.1
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-26 22:37:41 +01:00
Michael Niedermayer
2d0e415482 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-03-26 21:52:48 +01:00
Ico Doornekamp
daa6dc0a3b avformat/rtpdec_jpeg: fix low contrast image on low quality setting
Original mail and my own followup on ffmpeg-user earlier today:

I have a device sending out a MJPEG/RTP stream on a low quality setting.
Decoding and displaying the video with libavformat results in a washed
out, low contrast, greyish image. Playing the same stream with VLC results
in proper color representation.

Screenshots for comparison:

  http://zevv.nl/div/libav/shot-ffplay.jpg
  http://zevv.nl/div/libav/shot-vlc.jpg

A pcap capture of a few seconds of video and SDP file for playing the
stream are available at

  http://zevv.nl/div/libav/mjpeg.pcap
  http://zevv.nl/div/libav/mjpeg.sdp

I believe the problem might be in the calculation of the quantization
tables in the function create_default_qtables(), the attached patch
solves the issue for me.

The problem is that the argument 'q' is of the type uint8_t. According to the
JPEG standard, if 1 <= q <= 50, the scale factor 'S' should be 5000 / Q.
Because the create_default_qtables() reuses the variable 'q' to store the
result of this calculation, for small values of q < 19, q wil subsequently
overflow and give wrong results in the calculated quantization tables. The
patch below uses a new variable 'S' (same name as in RFC2435) with the proper
range to store the result of the division.

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

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-26 21:52:48 +01:00
Michael Niedermayer
6e5648ad42 avformat/mpegtsenc: Fix used service
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 26811fd946)

Conflicts:

	libavformat/version.h
2016-03-26 21:52:48 +01:00
Michael Niedermayer
e15a48d35a avformat/mpegtsenc: Keep track of the program for each service
Simplifies code

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

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-26 21:52:48 +01:00
Michael Niedermayer
0fae52d7e3 avformat/file: Add crypto to default whitelist
Fixes Ticket5287

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

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-26 21:52:47 +01:00
Michael Niedermayer
50a639a62a avcodec/mjpegenc_common: Store approximate aspect if exact cannot be stored
Fixes Ticket5244

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

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-26 21:52:47 +01:00
Mark Thompson
d6adcab842 lavc/hevc: Allow arbitrary garbage in bytestream as long as at least one NAL unit is found.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit fbec157ea0)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-26 21:52:47 +01:00
Michael Niedermayer
bf80b1d88d avcodec/resample: Remove disabled and faulty code
Fixes Ticket5345

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

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-26 21:52:47 +01:00
Luca Barbato
53fffc9fc4 indeo2: Fix banding artefacts
Rename luma table to delta table and change how it is used.

CC: libav-stable@libav.org
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Diego Biurrun <diego@biurrun.de>
(cherry picked from commit f8c34f4b8d)
(cherry picked from commit 73f3c8f73e)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-26 21:52:47 +01:00