1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00
Commit Graph

95291 Commits

Author SHA1 Message Date
Zhong Li
949a1b3e2f lavc/qsv: remove vaapi device free function
It is not needed since av_buffer_unref() will call it internally

Signed-off-by: Zhong Li <zhong.li@intel.com>
2019-10-09 10:44:04 +08:00
Raphaël Zumer
9d92403add avformat/ivfdec: Change the length field to 32 bits
Signed-off-by: Raphaël Zumer <rzumer@tebako.net>
2019-10-08 21:45:00 -04:00
Raphaël Zumer
d3807467b2 avformat/ivfenc: Change the length fields to 32 bits
There is no change in the encoded bitstream, but this
ensures that the written field length is consistent
with the reference implementation.

Unused bytes are zeroed out for backwards compatibility.

Signed-off-by: Raphaël Zumer <rzumer@tebako.net>
2019-10-08 21:44:41 -04:00
Raphaël Zumer
eeb1c515a8 avformat/ivfenc: Comment the length field encoding process
Signed-off-by: Raphaël Zumer <rzumer@tebako.net>
2019-10-08 21:44:36 -04:00
Zhao Zhili
971c890c05 avfilter/formats: remove unnecessary unreference 2019-10-08 17:51:10 +02:00
Michael Niedermayer
dd9e6d077e avcodec/dxv: Subtract 12 earlier in dxv_decompress_cocg()
the data_start is after reading 12 bytes and if its subtracted
at the very end the intermediate might overflow

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-10-08 16:24:58 +02:00
Michael Niedermayer
c371e50b4f libavcodec/dxv: Remove redundant seek
This seeks to the position the previous call to dxv_decompress_opcodes()
positioned us in case of success

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-10-08 16:24:58 +02:00
Michael Niedermayer
7f0498ed46 avcodec/ituh263dec: Check input for minimal frame size
Fixes: Timeout (28sec -> 3sec)
Fixes: 17559/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_H263_fuzzer-5681050776240128

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-10-08 16:24:58 +02:00
Michael Niedermayer
4a660fac98 avcodec/truemotion1: Check that the input has enough space for a minimal index_stream
Fixes: Timeout (18sec -> 0.4sec)
Fixes: 17585/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TRUEMOTION1_fuzzer-5117015135617024

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-10-08 16:24:58 +02:00
Michael Niedermayer
9a0d36e562 avformat/mpsubdec: Clear queue on error
Fixes: Memleaks
Fixes: 17219/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5720539124989952

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-10-08 16:24:58 +02:00
Michael Niedermayer
bf0ba75c4a avcodec/sunrast: Check that the input is large enough for the maximally compressed image
Fixes: Timeout (17sec -> 15ms)
Fixes: 17224/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SUNRAST_fuzzer-5663218491457536
Fixes: 17224/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SUNRAST_fuzzer-5735590015795200

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-10-08 16:24:58 +02:00
Michael Niedermayer
711ad71aea avcodec/sunrast: Check for availability of maplength before allocating image
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-10-08 16:24:58 +02:00
Michael Niedermayer
675c6d1e17 avcodec/jpeglsdec: Apply transform only to initialized lines
Fixes: Timeout (110sec -> 1sec)
Fixes: 17123/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AMV_fuzzer-5636452758585344

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-10-08 16:24:58 +02:00
Michael Niedermayer
fe7fbf3a22 avcodec/jpeglsdec: Return error codes from ls_decode_line()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-10-08 16:24:58 +02:00
Michael Niedermayer
c552c3ef70 avcodec/flac_parser: Make expected_frame_num, expected_sample_num 64bit
Fixes: Integer overflow
Fixes: 17199/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FLAC_fuzzer-5696145187143680

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-10-08 16:24:58 +02:00
Paul B Mahol
6023b9fbfe avfilter/af_anlms: add support for commands 2019-10-08 11:54:21 +02:00
Andreas Rheinhardt
ffb32d35ee avformat/mpeg: Remove set-but-unused variable
Forgotten in 7da57875.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2019-10-08 10:41:43 +02:00
vectronic
e149be38a8 avformat/hls: fix missing segment offset reset on last segment when http_multiple is enabled.
Reviewed-by: Steven Liu <lq@onvideo.cn>
Signed-off-by: vectronic <hello.vectronic@gmail.com>
2019-10-08 14:58:47 +08:00
vectronic
b21c5ef501 avformat/hls: pass http offset options to http request
made with persistent connections to prevent incorrect reset of
offset when demuxing HLS+FMP4

Signed-off-by: Steven Liu <lq@onvideo.cn>
Signed-off-by: vectronic <hello.vectronic@gmail.com>
2019-10-08 14:57:53 +08:00
vectronic
e81c686a95 avformat/http: add ff_http_do_new_request2 for options
add ff_http_do_new_request2() which supports options to be applied to
HTTPContext after initialisation with the new uri

Signed-off-by: Steven Liu <lq@onvideo.cn>
Signed-off-by: vectronic <hello.vectronic@gmail.com>
2019-10-08 14:57:44 +08:00
Limin Wang
afab93ccd0 avformat/hlsenc: replace with av_freep for all av_free
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2019-10-08 14:12:56 +08:00
Limin Wang
28bb73cee7 avformat/hlsenc: replace with av_dirname to get the directory
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2019-10-08 14:12:53 +08:00
Limin Wang
61aa77272a avformat/hlsenc: remove the unnecessary null pointer check
Reviewed-by: Steven Liu <lq@chinaffmpeg.org>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2019-10-08 14:12:49 +08:00
Limin Wang
a77fb510c2 avutil/avstring: support input path as a null pointer or empty string
Linux and OSX systems support basename and dirname via <libgen.h>, I plan to
make the wrapper interface conform to the standard interface first.
If it is feasible, I will continue to modify it to call the system interface
if there is already a system call interface.

You can get more description about the system interface by below command:
 "man 3 basename"

Reviewed-by: Marton Balint <cus@passwd.hu>
Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se>
Reviewed-by: Steven Liu <lq@chinaffmpeg.org>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2019-10-08 14:12:43 +08:00
Steven Liu
985ed65117 avfilter/vf_pad: add logging context to log
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2019-10-08 13:47:47 +08:00
Steven Liu
9b2155ad3f avfilter/boxblur: add logging context to log
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2019-10-08 13:47:43 +08:00
Steven Liu
3dead10fa3 avfilter/vf_scale_qsv: add logging context to log
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2019-10-08 13:47:38 +08:00
Steven Liu
acc1256654 avfilter/vf_crop: add logging context to log
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2019-10-08 13:47:34 +08:00
Steven Liu
aea36b6357 avcodec/pngdec: add logging context to log
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2019-10-08 13:47:31 +08:00
Steven Liu
4aa391388a avcodec/videotoolbox: add logging context to log
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2019-10-08 13:47:25 +08:00
Steven Liu
76ab5ebbee avcodec/mpegvideo_enc: add logging context to log
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2019-10-08 13:47:21 +08:00
Steven Liu
8c16c133d0 avformat/mms: add logging context to log
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2019-10-08 13:47:16 +08:00
Steven Liu
cdf8253a06 avformat/mmst: add logging context to log
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2019-10-08 13:47:12 +08:00
Steven Liu
4ff97342ce avformat/network: add logging context to log
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2019-10-08 13:47:07 +08:00
Steven Liu
17236a2c40 avformat/avidec: add logging context to log
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2019-10-08 13:46:58 +08:00
Steven Liu
35236fd729 avformat/rtmpptoto: add logging context to log
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2019-10-08 13:46:53 +08:00
Steven Liu
5db50dbf06 avformat/udp: add logging context to log
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2019-10-08 13:46:42 +08:00
Steven Liu
db99b32a1b avformat/hlsenc: add logging context to log
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2019-10-08 13:46:32 +08:00
elliottk
14941d386a Change libvpxenc default to crf=32.
Current default is 200kbps, which produces inconsistent
results (too high for low-res, too low for hi-res). Use
CRF instead, which will adapt. Affects VP9. Also have
VP8 use a default bitrate of 256kbps.

Signed-off-by: James Zern <jzern@google.com>
2019-10-07 22:32:32 -07:00
Zhong Li
8df91de9aa lavfi/normalize: remove the unused pointer
Signed-off-by: Zhong Li <zhong.li@intel.com>
2019-10-08 10:25:28 +08:00
Zhong Li
6f0dd6b4ab lavc/qsv: fix a memory leak in ff_qsv_set_display_handle()
Reported-by: Linjie Fu <linjie.fu@intel.com>
Signed-off-by: Zhong Li <zhong.li@intel.com>
2019-10-08 10:25:01 +08:00
Andreas Rheinhardt
1d54309c8a avcodec/flac_parser: Cosmetics
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2019-10-07 22:53:40 +02:00
Andreas Rheinhardt
5873feac54 avcodec/flac_parser: Don't leave stale pointer in memory
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2019-10-07 22:53:34 +02:00
Andreas Rheinhardt
87b30f8af8 avcodec/flac_parser: Don't modify size of the input buffer
When flushing, MAX_FRAME_HEADER_SIZE bytes (always zero) are supposed to
be written to the fifo buffer in order to be able to check the rest of
the buffer for frame headers. It was intended to write these by writing
a small buffer of size MAX_FRAME_HEADER_SIZE to the buffer. But the way
it was actually done ensured that this did not happen:

First, it would be checked whether the size of the input buffer was zero,
in which case it buf_size would be set to MAX_FRAME_HEADER_SIZE and
read_end would be set to indicate that MAX_FRAME_HEADER_SIZE bytes need
to be written. Then it would be made sure that there is enough space in
the fifo for the data to be written. Afterwards the data is written. The
check used here is for whether buf_size is zero or not. But if it was
zero initially, it is MAX_FRAME_HEADER_SIZE now, so that not the
designated buffer for writing MAX_FRAME_HEADER_SIZE is written; instead
the padded buffer (from the stack of av_parser_parse2()) is used. This
works because AV_INPUT_BUFFER_PADDING_SIZE >= MAX_FRAME_HEADER_SIZE.
Lateron, buf_size is set to zero again.

Given that since 7edbd536, the actual amount of data read is no longer
automatically equal to buf_size, it is completely unnecessary to modify
buf_size at all. Moreover, modifying it is dangerous: Some allocations
can fail and because buf_size is never reset to zero in this codepath,
the parser might return a value > 0 on flushing.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2019-10-07 22:53:28 +02:00
Andreas Rheinhardt
a1701e7591 avcodec/flac_parser: Remove superfluous checks
For a parser, the input buffer is always != NULL: In case of flushing,
the indicated size of the input buffer will be zero and the input buffer
will point to a zeroed buffer of size 0 + AV_INPUT_BUFFER_PADDING.
Therefore one does not need to check for whether said buffer is NULL or
not.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2019-10-07 22:53:19 +02:00
Andreas Rheinhardt
047a6d396f avcodec/flac_parser: Fix number of buffered headers
Only decrement the number of buffered headers if a header has actually
been freed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2019-10-07 22:53:13 +02:00
Andreas Rheinhardt
e5e5be4c7f avcodec/flac_parser: Fix off-by-one error
The flac parser uses a fifo to buffer its data. Consequently, when
searching for sync codes of flac packets, one needs to take care of
the possibility of wraparound. This is done by using an optimized start
code search that works on each of the continuous buffers separately and
by explicitly checking whether the last pre-wrap byte and the first
post-wrap byte constitute a valid sync code.

Moreover, the last MAX_FRAME_HEADER_SIZE - 1 bytes ought not to be searched
for (the start of) a sync code because a header that might be found in this
region might not be completely available. These bytes ought to be searched
lateron when more data is available or when flushing.

Unfortunately there was an off-by-one error in the calculation of the
length to search of the post-wrap buffer: It was too large, because the
calculation was based on the amount of bytes available in the fifo from
the last pre-wrap byte onwards. This meant that a header might be
parsed twice (once prematurely and once regularly when more data is
available); it could also mean that an invalid header will be treated as
valid (namely if the length of said invalid header is
MAX_FRAME_HEADER_SIZE and the invalid byte that will be treated as the
last byte of this potential header happens to be the right CRC-8).

Should a header be parsed twice, the second instance will be the best child
of the first instance; the first instance's score will be
FLAC_HEADER_BASE_SCORE - FLAC_HEADER_CHANGED_PENALTY ( = 3) higher than
the second instance's score. So the frame belonging to the first
instance will be output and it will be done as a zero length frame (the
difference of the header's offset and the child's offset). This has
serious consequences when flushing, as returning a zero length buffer
signals to the caller that no more data will be output; consequently the
last frames not yet output will be dropped.

Furthermore, a "sample/frame number mismatch in adjacent frames" warning
got output when returning the zero-length frame belonging to the first
header, because the child's sample/frame number of course didn't match
the expected sample frame/number given its parent.

filter/hdcd-mix.flac from the FATE-suite was affected by this (the last
frame was omitted) which is the reason why several FATE-tests needed to
be updated.

Fixes ticket #5937.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2019-10-07 22:27:18 +02:00
Andreas Rheinhardt
d03c3e8517 avcodec/flac_parser: Don't allocate array separately
The FLACHeaderMarker structure contained a pointer to an array of int;
said array was always allocated and freed at the same time as its
referencing FLACHeaderMarker; the pointer was never modified to point to
a different array and each FLACHeaderMarker had its own unique array.
Furthermore, all these arrays had a constant size. Therefore include
this array in the FLACHeaderMarker struct.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2019-10-07 22:27:18 +02:00
Andreas Rheinhardt
5e546864b0 avcodec/flac_parser: Use native endianness when possible
FLAC sync codes contain a byte equal to 0xFF and so the function that
searches for sync codes first searched for this byte. It did this by
checking four bytes at once; these bytes have been read via AV_RB32, but
the test works just as well with native endianness.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2019-10-07 22:27:18 +02:00
Andreas Rheinhardt
69dd8d3a2a avformat/flac_picture: Avoid allocation of AVIOContext
Put an AVIOContext whose lifetime doesn't extend beyond the function
where it is allocated on the stack instead of allocating and freeing it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2019-10-07 22:27:17 +02:00