Commit Graph

86764 Commits

Author SHA1 Message Date
Michael Niedermayer 341f01290c avcodec/magicyuv: Check that vlc len is not too large
Fixes: runtime error: shift exponent -95 is negative
Fixes: 2568/clusterfuzz-testcase-minimized-4926115716005888

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-07-12 17:26:18 +02:00
Michael Niedermayer c28f648b19 avcodec/mjpegdec: Clip DC also on the negative side.
Fixes: runtime error: signed integer overflow: -16711425 + -2130772346 cannot be represented in type 'int'
Fixes: 2533/clusterfuzz-testcase-minimized-5372857678823424

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-07-12 16:32:27 +02:00
Michael Niedermayer 80b9e40b6f avcodec/aacps (fixed point): Fix multiple signed integer overflows
Fixes: runtime error: signed integer overflow: 1421978265 - -1810326882 cannot be represented in type 'int'
Fixes: 2527/clusterfuzz-testcase-minimized-5260915396050944

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-07-12 04:20:21 +02:00
Wan-Teh Chang 15c41cb6ad pthread_frame: save the FF_DEBUG_THREADS option in PerThreadContext.
Add the debug_threads boolean field to PerThreadContext. For
PerThreadContext *p, p->debug_threads records whether the
FF_DEBUG_THREADS bit is set in p->avctx->debug, and p->debug_threads and
p->avctx->debug are kept in sync. The debug_threads field is defined as
an atomic_int to allow atomic read by another thread in
ff_thread_await_progress().

This fixes the tsan warning that
2e664b9c1e attempted to fix:

WARNING: ThreadSanitizer: data race (pid=452658)
  Write of size 4 at 0x7b640003f4fc by main thread (mutexes: write M248499):
    #0 update_context_from_user [..]/libavcodec/pthread_frame.c:335:19 (5ab42bb1a6f4b068d7863dabe9b2bacc+0xe73859)
[..]
  Previous read of size 4 at 0x7b640003f4fc by thread T130 (mutexes: write M248502, write M248500):
    #0 ff_thread_await_progress [..]/libavcodec/pthread_frame.c:591:26 (5ab42bb1a6f4b068d7863dabe9b2bacc+0xe749a1)

Signed-off-by: Wan-Teh Chang <wtc@google.com>
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2017-07-11 21:27:35 -04:00
Rostislav Pehlivanov c34ece57c7 aacdec_template: fix non-power-of-two MDCT scale sign
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2017-07-12 02:15:19 +01:00
Rostislav Pehlivanov 594cd1f38a opus_celt: normalize using mdct scale
Removes a per-sample divide in the IIR filter deemphasis filter.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2017-07-11 21:36:48 +01:00
Rostislav Pehlivanov aef5f9ab05 mdct15: remove redundant scale argument to imdct_half
The only use of that argument was for Opus downmixing which is very rare
and better done after the mdcts.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2017-07-11 21:36:48 +01:00
wm4 02d248d582 videotoolbox: fix crash when decoding interlaced video with new API 2017-07-11 18:27:27 +02:00
Muhammad Faiz 0780ad9c68 avcodec/rdft: remove sintable
It is redundant with costable. The first half of sintable is
identical with the second half of costable. The second half
of sintable is negative value of the first half of sintable.

The computation is changed to handle sign of sin values, in
C code and ARM assembly code.

Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
2017-07-11 13:22:02 +07:00
Rostislav Pehlivanov e7d977b446 opus_rc: fix encoder desyncs on very low bitrates
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2017-07-10 23:49:44 +01:00
Rostislav Pehlivanov 8041b2420f opusenc: don't set avctx->cutoff
Its only use is to adjust the aac psychoacoustic/filter system which
isn't used here.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2017-07-10 23:49:44 +01:00
Rostislav Pehlivanov 03d8fbc09c opustab: comment ff_celt_tf_select
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2017-07-10 23:49:44 +01:00
Rostislav Pehlivanov ba67c2349c opus_celt: move postfilter taps table to the shared opustab.c file
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2017-07-10 23:49:44 +01:00
Derek Buitenhuis 5ca063799c rtspdec: Fix return error
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2017-07-10 15:02:29 -04:00
wm4 c64da19bbc dxva: DXVA2_ModeHEVC_VLD_Main10 does not support Main
This mode apparently does not support decoding of HEVC Main (8 bit).
With D3D11 and Intel drivers on Windows 10 I get green corruption, while
using DXVA2_ModeHEVC_VLD_Main works.
2017-07-10 16:03:15 +02:00
Paul B Mahol 0281d5ece6 avcodec/magicyuv: add 12 bit formats
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-07-10 12:03:08 +02:00
Paul B Mahol fa3fd7f5a0 avcodec/magicyuv: make RLE table reading match reference
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-07-10 12:03:08 +02:00
Wan-Teh Chang 2f84f40d45 avformat/avio: Remove no-op code in url_find_protocol().
In url_find_protocol(), proto_str is either "file" or a string
consisting of only the characters in URL_SCHEME_CHARS, which does not
include ','. Therefore the strchr(proto_str, ',') call always returns
NULL.

Note: The code was added in commit
6161c41817.

Signed-off-by: Wan-Teh Chang <wtc@google.com>
Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
2017-07-10 06:56:51 +07:00
Marton Balint b406f387c8 avcodec/noise_bsf: add support for dropping packets
Signed-off-by: Marton Balint <cus@passwd.hu>
2017-07-09 19:41:58 +02:00
Michael Niedermayer fe9242204d avcodec/ylc: Fix vlc of 31 bits
Fixes: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
Fixes: 2515/clusterfuzz-testcase-minimized-6197200012967936

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-07-08 23:45:47 +02:00
Michael Niedermayer 2061de8a3f avcodec/sbrdsp_fixed: Fix integer overflow in sbr_hf_apply_noise()
Fixes: runtime error: signed integer overflow: -2049425300 + -117591631 cannot be represented in type 'int'
Fixes: part of 2096/clusterfuzz-testcase-minimized-4901566068817920

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-07-08 23:45:41 +02:00
hexpointer 3fa8f263ab libswresample: check input to swr_convert_frame for NULL
When 'out' is an AVFrame that does not have buffers preallocated,
swr_convert_frame tries to allocate buffers of the right size. However
in calculating this size it failed to check for whether 'in' is NULL
(requesting that swr's internal buffers are to be flushed).

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-07-08 18:13:43 +02:00
Paul B Mahol 01e545d046 avfilter: add limiter filter
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-07-08 11:49:54 +02:00
Derek Buitenhuis 51db262312 bitstream_filter: Add missing error check
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2017-07-07 15:32:37 -04:00
Derek Buitenhuis b198e09138 af_amix: Add missing error check
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2017-07-07 15:32:03 -04:00
Derek Buitenhuis c27d7c027c rtmpproto: Fix error return
Mistake was added in 5840473890.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2017-07-07 15:30:57 -04:00
Derek Buitenhuis aa2bc61a3e cngenc: Remove dead store
ff_lpc_calc_ref_coeffs returns the order it is given and cannot return
in error.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2017-07-07 15:29:57 -04:00
Derek Buitenhuis d74ba68acf ffmpeg_opt: Make get_timecode actually return errors
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2017-07-07 15:27:22 -04:00
Derek Buitenhuis 179bf86fa2 opusdec: Remove dead code
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2017-07-07 15:26:35 -04:00
Derek Buitenhuis f7daed8545 scpr: Added missing error check
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2017-07-07 15:25:46 -04:00
Derek Buitenhuis 704b774ae0 af_tempo: Add missing error check
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2017-07-07 15:24:49 -04:00
Derek Buitenhuis b603ef0870 bitpacked: Remove dead store
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2017-07-07 15:23:58 -04:00
Tobias Rapp 8bf9572e9a avformat: remove obsolete commented-out DEBUG define
Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2017-07-07 11:57:39 -04:00
DongHoon Kang db8f615d68 libavcodec/htmlsubtitles.c: make tags case-insensitive
Signed-off-by: DongHoon Kang <nanuda.kang@gmail.com>
Signed-off-by: Clément Bœsch <u@pkh.me>
2017-07-07 12:01:00 +02:00
Muhammad Faiz 1af615683e avcodec/fft_template: use ff_thread_once on costable initialization
Make it thread-safe and avoid redundant initialization.

Reviewed-by: Rostislav Pehlivanov <atomnuker@gmail.com>
Reviewed-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
2017-07-07 09:41:52 +07:00
Derek Buitenhuis 2d417076a2 avformat/hlsenc: Add missing error check
Reviewed-by: Steven Liu <lq@onvideo.cn>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2017-07-07 10:08:18 +08:00
Steven Liu 23e21130bb avformat/hlsenc: add warn message when use both fmp4 and single_file
have not implementation the fmp4 single file yet before this commit.

Suggested-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Steven Liu <lq@onvideo.cn>
2017-07-07 10:05:54 +08:00
Wan-Teh Chang dc11a467e6 ffmpeg: Fix typos in the comment for decode() ("." vs. "->")
pkt is a pointer, so it should be dereferenced with the -> operator.

Signed-off-by: Wan-Teh Chang <wtc@google.com>
Reviewed-by: Steven Liu <lingjiujianke@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-07-07 03:48:56 +02:00
Rafaël Carré 3b9cf943c9 h264dec: remove unneeded prototype
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-07-07 03:48:56 +02:00
Derek Buitenhuis fde9013ab4 mpegtsenc: Don't pass NULL to memcpy
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2017-07-06 21:28:20 -04:00
Ricardo Constantino 3b3501f75c configure: require pkg-config for libvorbis
libvorbis comes with pkg-config files since at least v1.0.1, way back in 2003.

We need the two checks for vorbis and vorbisenc because we use functions from
both and Xiph considers them separate libraries.

The check is inverted (vorbis first then vorbisenc) because add_extralibs()
prepends to EXTRALIBS instead of appending. For both shared and static linking
the order didn't seem to matter anyway, testing with MinGW.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2017-07-06 15:39:10 -04:00
Derek Buitenhuis 99c68861f9 concatdec: Do not pass NULL to memcmp
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2017-07-06 15:35:32 -04:00
wm4 f605b56ad9 htmlsubtitles: support <br> tag
Some .srt files use this tag.

(An alternative implementation would be correctly ignoring unknown tags,
and treating them as whitespace. libass can do automatic line wrapping.)
2017-07-06 10:04:55 +02:00
Michael Niedermayer f1baafac71 avcodec/interplayvideo: Clean up frames on parameter change
Fixes: out of array access
Fixes: 2467/clusterfuzz-testcase-minimized-4755798049685504

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-07-06 03:59:09 +02:00
Azamat H. Hackimov 121ab69c9d libavformat/gdv: Fix parsing for soundless video
Added 2 byte skipping if there no sound present, that fixes playback
files without sound stream.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-07-05 23:25:58 +02:00
John Stebbins 369a3e111c movenc: allow alternative hvc1 h.265 codec tag
If AVCodecParameters.codec_tag is 'hvc1' use it instead of 'hev1' for
h.265 streams. QuickTime (and other Apple software) requires 'hvc1'.

(cherry picked from commit 84ab1cc437)
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2017-07-05 15:55:25 -04:00
John Stebbins 974d508e57 movenc: write correct format hvcc when tag is hvc1
(cherry picked from commit 1ea9b7fdf9)
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2017-07-05 15:55:25 -04:00
John Stebbins 38d808d72e movenc: move tags definitions to where they are used
(cherry picked from commit 1c64bae648)
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2017-07-05 15:55:25 -04:00
John Stebbins e199d90da6 movenc: simplify codec_tag lookup
mux.c init_muxer() already sets codec_tag correctly in the cases
simplified here.

This also adds the capability to support alternative tags for the
same codec_id.

(cherry picked from commit f6f86f432f)
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2017-07-05 15:55:25 -04:00
James Almer 9878935927 fate: add fate-checkasm-sbrdsp target
Signed-off-by: James Almer <jamrial@gmail.com>
2017-07-05 16:54:16 -03:00