ffmpeg.git
3 years agoffmpeg_cuvid: adapt for recent filter graph initialization changes
Timo Rothenpieler [Thu, 9 Feb 2017 20:33:51 +0000 (21:33 +0100)]
ffmpeg_cuvid: adapt for recent filter graph initialization changes

3 years agoffmpeg: restructure sending EOF to filters
Anton Khirnov [Mon, 27 Jun 2016 17:03:42 +0000 (19:03 +0200)]
ffmpeg: restructure sending EOF to filters

Be more careful when an input stream encounters EOF when its filtergraph
has not been configured yet. The current code would immediately mark the
corresponding output streams as finished, while there may still be
buffered frames waiting for frames to appear on other filtergraph
inputs.

This should fix the random FATE failures for complex filtergraph tests
after a3a0230a9870b9018dc7415ae5872784d524cfe5

This merges Libav commit 94ebf55. It was previously skipped.

This is the last filter init related Libav commit that was skipped, so
this also removes the commits from doc/libav-merge.txt.

Signed-off-by: wm4 <nfxjfg@googlemail.com>
3 years agoffmpeg: move flushing the queued frames to configure_filtergraph()
Anton Khirnov [Mon, 27 Jun 2016 16:59:23 +0000 (18:59 +0200)]
ffmpeg: move flushing the queued frames to configure_filtergraph()

This is a more appropriate place for it, and will also be useful in the
following commit.

This merges Libav commit d2e56cf. It was previously skipped.

Signed-off-by: wm4 <nfxjfg@googlemail.com>
3 years agoffmpeg: fix printing of filter input/output names
wm4 [Wed, 8 Feb 2017 11:55:58 +0000 (12:55 +0100)]
ffmpeg: fix printing of filter input/output names

Broken by the previous Libav commit (even in Libav, thus a separate
commit).

Signed-off-by: wm4 <nfxjfg@googlemail.com>
3 years agoffmpeg: init filtergraphs only after we have a frame on each input
Anton Khirnov [Fri, 27 May 2016 10:14:33 +0000 (12:14 +0200)]
ffmpeg: init filtergraphs only after we have a frame on each input

This makes sure the actual stream parameters are used, which is
important mainly for hardware decoding+filtering cases, which would
previously require various weird workarounds to handle the fact that a
fake software graph has to be constructed, but never used.
This should also improve behaviour in rare cases where
avformat_find_stream_info() does not provide accurate information.

This merges Libav commit a3a0230. It was previously skipped.

The code in flush_encoders() which sets up a "fake" format wasn't in
Libav. I'm not sure if it's a good idea, but it tends to give
behavior closer to the old one in certain corner cases.

The vp8-size-change gives different result, because now the size of
the first frame is used. libavformat reported the size of the largest
frame for some reason.

The exr tests now use the sample aspect ratio of the first frame. For
some reason libavformat determines 0/1 as aspect ratio, while the
decoder returns the correct one.

The ffm and mxf tests change the field_order values. I'm assuming
another libavformat/decoding mismatch.

Signed-off-by: wm4 <nfxjfg@googlemail.com>
3 years agoffmpeg: do packet ts rescaling in write_packet()
Anton Khirnov [Fri, 27 May 2016 10:04:29 +0000 (12:04 +0200)]
ffmpeg: do packet ts rescaling in write_packet()

This will be useful in the following commit, after which the muxer
timebase is not always available when encoding.

This merges Libav commit 3e265ca. It was previously skipped.

There are some changes with how/when the mux_timebase field is set,
because the Libav approach often causes a too imprecise time base
to be set. This is hard, because the muxer's write_header function
can readjust the timebase, at which point we might already have
encoded packets buffered. (It might be better to buffer them after
the encoder, instead of after all the timestamp handling logic
before muxing.)

The two FATE tests change because the output time base is raised
for subtitles. (Needed to avoid certain rounding issues in other
cases.)

Includes a minor merge fix by Mark Thompson, and

    avconv: Move rescale to stream timebase before monotonisation

also by Mark Thompson <sw@jkqxz.net>.

Signed-off-by: wm4 <nfxjfg@googlemail.com>
3 years agoffmpeg: make sure packets put into the muxing FIFO are refcounted
wm4 [Wed, 8 Feb 2017 08:53:26 +0000 (09:53 +0100)]
ffmpeg: make sure packets put into the muxing FIFO are refcounted

Some callers (like do_subtitle_out()) call this with an AVPacket that is
not refcounted. This can cause undefined behavior.

Calling av_packet_move_ref() does not make a packet refcounted if it
isn't yet. (And it can't be made to, because it always succeeds,
and can't return ENOMEM.)

Call av_packet_ref() instead to make sure it's refcounted.

I couldn't find a case that is fixed by this with the current code. But
it will fix the fate-pva-demux test with the later patches applied.

Signed-off-by: wm4 <nfxjfg@googlemail.com>
3 years agolavf/matroska: Support codec ID V_FFV1 for demuxing.
Carl Eugen Hoyos [Wed, 1 Mar 2017 22:40:35 +0000 (23:40 +0100)]
lavf/matroska: Support codec ID V_FFV1 for demuxing.

Fixes ticket #6206.

3 years agoRevert "avutil/frame: Disallow zero sized frame side data"
Michael Niedermayer [Wed, 1 Mar 2017 12:02:11 +0000 (13:02 +0100)]
Revert "avutil/frame: Disallow zero sized frame side data"

Found a case where we use size==0, the other related commits
remain needed, and should be sufficient to fix the original issue

This reverts commit 7e4f32f4e4b93c95dcc872cb844c5548e69f352e.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/interplayvideo: Fix timeout from lack of bitstream end check
Michael Niedermayer [Wed, 1 Mar 2017 16:56:23 +0000 (17:56 +0100)]
avcodec/interplayvideo: Fix timeout from lack of bitstream end check

Fixes: 697/clusterfuzz-testcase-6111250582863872

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/mpegaudiodec_template: Fix runtime error: signed integer overflow: 2053224902...
Michael Niedermayer [Wed, 1 Mar 2017 15:35:58 +0000 (16:35 +0100)]
avcodec/mpegaudiodec_template: Fix runtime error: signed integer overflow: 2053224902 + 2053224902 cannot be represented in type 'int'

Fixes: 696/clusterfuzz-testcase-5853632270434304

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/mjpegdec: Fix runtime error: left shift of negative value -511
Michael Niedermayer [Wed, 1 Mar 2017 15:32:09 +0000 (16:32 +0100)]
avcodec/mjpegdec: Fix runtime error: left shift of negative value -511

Fixes: 693/clusterfuzz-testcase-6109776066904064

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agolavc/sheervideo: Fix Y prediction for interlaced frames with transparency.
Carl Eugen Hoyos [Wed, 1 Mar 2017 22:45:10 +0000 (23:45 +0100)]
lavc/sheervideo: Fix Y prediction for interlaced frames with transparency.

Based on 260de8a2 by Paul B Mahol.
Fixes ticket #6210.

3 years agodoc: Link to "Resampler Options" in the aresample documentation.
Carl Eugen Hoyos [Thu, 2 Mar 2017 17:05:58 +0000 (18:05 +0100)]
doc: Link to "Resampler Options" in the aresample documentation.

3 years agoavcodec: add ClearVideo decoder
Kostya Shishkov [Thu, 2 Mar 2017 10:21:48 +0000 (11:21 +0100)]
avcodec: add ClearVideo decoder

Only I-frames are decoded for now.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
3 years agohwcontext_vaapi: Don't abort on failing to allocate from a fixed-size pool
Mark Thompson [Fri, 25 Nov 2016 12:36:05 +0000 (12:36 +0000)]
hwcontext_vaapi: Don't abort on failing to allocate from a fixed-size pool

Cherry-picked from Libav d30719e62de68975cbc7ffd318df03a183037563.

Signed-off-by: wm4 <nfxjfg@googlemail.com>
3 years agoavcodec/videotoolbox: set kCVPixelBufferIOSurfaceOpenGLTextureCompatibilityKey
wm4 [Fri, 24 Feb 2017 09:48:13 +0000 (10:48 +0100)]
avcodec/videotoolbox: set kCVPixelBufferIOSurfaceOpenGLTextureCompatibilityKey

Makes sure the output can be mapped as OpenGL texture.
This is what at least video players normally want.

3 years agoavcodec/videotoolbox: allow not setting the kCVPixelBufferPixelFormatTypeKey
wm4 [Fri, 24 Feb 2017 09:17:34 +0000 (10:17 +0100)]
avcodec/videotoolbox: allow not setting the kCVPixelBufferPixelFormatTypeKey

If AVVideotoolboxContext.cv_pix_fmt_type is set to 0, don't set the
kCVPixelBufferPixelFormatTypeKey value on the VT decoder.

This makes VT output its native format, which can be much faster on
some hardware iterations (if the native format does not match with
the requested format, it will be converted, which is slow).

The default is still forcing nv12.

3 years agoavformat: fix AVStream private fields marker
wm4 [Mon, 13 Feb 2017 10:50:54 +0000 (11:50 +0100)]
avformat: fix AVStream private fields marker

Public fields were added after the private fields (negating the entire
point of this). New private fields go into AVStreamInternal anyway.

The new marker was set by guessing which fields are supposed to be
private and wshich not. recommended_encoder_configuration is accessed by
ffserver_config.c directly, and is supposed to use the public API.

ffmpeg.c accesses AVStream.cur_dts, even though it's a private field,
but that seems to be an older error.

3 years agoavcodec, avutil, avformat: remove AVOption requirement for some fields
wm4 [Mon, 13 Feb 2017 10:40:22 +0000 (11:40 +0100)]
avcodec, avutil, avformat: remove AVOption requirement for some fields

Allow all struct fields to be accessed directly, as long as they're
public.

Before this change, many fields were "public", but could be accessed via
AVOption only. This meant they were effectively not public, but were
present for documentation purposes, which was incredibly confusing at
best.

3 years agolavf/flacdec: Return maximum score if the streaminfo header is valid.
Carl Eugen Hoyos [Thu, 2 Mar 2017 08:29:10 +0000 (09:29 +0100)]
lavf/flacdec: Return maximum score if the streaminfo header is valid.

3 years agoavcodec/vp56: Clear dimensions in case of failure in the middle of a resolution change
Michael Niedermayer [Wed, 1 Mar 2017 03:28:23 +0000 (04:28 +0100)]
avcodec/vp56: Clear dimensions in case of failure in the middle of a resolution change

Similar code is used elsewhere in vp56 to force a more complete reinit in the future.
Fixes null pointer dereference
Fixes: 707/clusterfuzz-testcase-4717453097566208

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/wavpack: Check value before shift in wp_exp2()
Michael Niedermayer [Tue, 28 Feb 2017 21:07:38 +0000 (22:07 +0100)]
avcodec/wavpack: Check value before shift in wp_exp2()

Fixes undefined shift, all callers should be changed to check the value
they use with wp_exp2() or its return value.

Fixes: 692/clusterfuzz-testcase-5757381516460032

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/ituh263dec: Use 0xffff as error code in h263p_decode_umotion()
Michael Niedermayer [Tue, 28 Feb 2017 21:07:37 +0000 (22:07 +0100)]
avcodec/ituh263dec: Use 0xffff as error code in h263p_decode_umotion()

This matches ff_h263_decode_motion() both functions error codes are interpreted by the same common code

Fixes: 690/clusterfuzz-testcase-4744944981901312

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/h264idct_template: Fix several runtime error: signed integer overflow
Michael Niedermayer [Tue, 28 Feb 2017 21:07:36 +0000 (22:07 +0100)]
avcodec/h264idct_template: Fix several runtime error: signed integer overflow

Fixes: 689/clusterfuzz-testcase-6029352737177600

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/oggdec: fix leak in ogg_restore()
Michael Niedermayer [Tue, 28 Feb 2017 14:16:54 +0000 (15:16 +0100)]
avformat/oggdec: fix leak in ogg_restore()

Fixes: asan_bug_leak

Found-by: Thomas Guilbert <tguilbert@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/oggdec: Factor free_stream out
Michael Niedermayer [Tue, 28 Feb 2017 14:16:23 +0000 (15:16 +0100)]
avformat/oggdec: Factor free_stream out

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/oggdec: remove unused parameter of ogg_restore()
Michael Niedermayer [Tue, 28 Feb 2017 12:36:29 +0000 (13:36 +0100)]
avformat/oggdec: remove unused parameter of ogg_restore()

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agolavc/videotoolboxenc: fix symbol linking
Rick Kern [Wed, 1 Mar 2017 15:39:13 +0000 (10:39 -0500)]
lavc/videotoolboxenc: fix symbol linking

Removes explicit reference to symbols and fixes dereferencing issue.

Signed-off-by: Rick Kern <kernrj@gmail.com>
3 years agoavcodec/vp8: Check for bitsteam end in decode_mb_row_no_filter()
Michael Niedermayer [Tue, 28 Feb 2017 02:55:02 +0000 (03:55 +0100)]
avcodec/vp8: Check for bitsteam end in decode_mb_row_no_filter()

Fixes timeout with 686/clusterfuzz-testcase-5853946876788736

this shortcuts (i.e. speeds up) the error and
return-to-user when decoding a truncated frame

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Previous version reviewed by: "Ronald S. Bultje" <rsbultje@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/h264_direct: Fix runtime error: left shift of negative value -14
Michael Niedermayer [Tue, 28 Feb 2017 02:13:24 +0000 (03:13 +0100)]
avcodec/h264_direct: Fix runtime error: left shift of negative value -14

Fixes: 682/clusterfuzz-testcase-4799120021651456

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/avpacket: Check metadata key in av_packet_unpack_dictionary()
Michael Niedermayer [Mon, 27 Feb 2017 03:12:09 +0000 (04:12 +0100)]
avcodec/avpacket: Check metadata key in av_packet_unpack_dictionary()

Fixes timeout
Fixes: 501/clusterfuzz-testcase-5672752870588416

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoMakefile: Clean compat/atomics/pthread subdirectory.
Carl Eugen Hoyos [Wed, 1 Mar 2017 12:42:43 +0000 (13:42 +0100)]
Makefile: Clean compat/atomics/pthread subdirectory.

3 years agoavcodec/nvenc: add initial QP value options
Konda Raju [Tue, 28 Feb 2017 05:39:12 +0000 (11:09 +0530)]
avcodec/nvenc: add initial QP value options

Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
3 years agoavcodec/nvenc: remove qmin and qmax constraints for vbr
Ganapathy Raman Kasi [Fri, 24 Feb 2017 01:42:27 +0000 (01:42 +0000)]
avcodec/nvenc: remove qmin and qmax constraints for vbr

qmin and qmax are not necessary for nvenc vbr.
Enforcing this constraint, doesn't allow user to use vbr 2 pass mode without explicity setting the qmin and qmax options

Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
3 years agocompat/cuda: fix ulong size on cygwin
Timo Rothenpieler [Mon, 27 Feb 2017 22:57:42 +0000 (23:57 +0100)]
compat/cuda: fix ulong size on cygwin

3 years agoMakefile: Clean compat subdirectory.
Carl Eugen Hoyos [Tue, 21 Feb 2017 13:36:15 +0000 (14:36 +0100)]
Makefile: Clean compat subdirectory.

Fixes ticket #5546.

3 years agolavf/matroskadec: Fix demuxing sipr.
Carl Eugen Hoyos [Tue, 28 Feb 2017 20:51:26 +0000 (21:51 +0100)]
lavf/matroskadec: Fix demuxing sipr.

Regression since 2c8d876d

3 years agoMAINTAINERS: Add Rodger Combs to ffmpeg-security
Michael Niedermayer [Thu, 23 Feb 2017 16:34:42 +0000 (17:34 +0100)]
MAINTAINERS: Add Rodger Combs to ffmpeg-security

Rodger Combs will be added to the ffmpeg-security alias when this patch is applied

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Reviewed-by: Clément Bœsch <u@pkh.me>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoMAINTAINERS: add wm4 to ffmpeg-security
Michael Niedermayer [Thu, 23 Feb 2017 16:34:41 +0000 (17:34 +0100)]
MAINTAINERS: add wm4 to ffmpeg-security

wm4 will be added to the ffmpeg-security alias when this patch is applied

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Reviewed-by: Clément Bœsch <u@pkh.me>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoMAINTAINERS: Make formating of ffmpeg-security entry the same as others
Michael Niedermayer [Thu, 23 Feb 2017 16:34:40 +0000 (17:34 +0100)]
MAINTAINERS: Make formating of ffmpeg-security entry the same as others

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/vp56: Factorize vp56_render_mb() out
Michael Niedermayer [Sat, 25 Feb 2017 20:07:22 +0000 (21:07 +0100)]
avcodec/vp56: Factorize vp56_render_mb() out

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/dca: Fix multiple runtime error: signed integer overflow
Michael Niedermayer [Sun, 26 Feb 2017 19:28:02 +0000 (20:28 +0100)]
avcodec/dca: Fix multiple runtime error: signed integer overflow

Fixes: 680/clusterfuzz-testcase-5416627266912256
Fixes: 681/clusterfuzz-testcase-5013323462475776

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/pictordec: Check plane value before doing value/mask computations
Michael Niedermayer [Sun, 26 Feb 2017 19:28:00 +0000 (20:28 +0100)]
avcodec/pictordec: Check plane value before doing value/mask computations

Fixes integer overflow
Fixes: 675/clusterfuzz-testcase-6722971232108544

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/mpeg4videodec: Fix runtime error: left shift of negative value -2650
Michael Niedermayer [Sun, 26 Feb 2017 19:27:59 +0000 (20:27 +0100)]
avcodec/mpeg4videodec: Fix runtime error: left shift of negative value -2650

Fixes: 674/clusterfuzz-testcase-6713275880308736

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/h264idct_template: Fix multiple runtime error: signed integer overflow
Michael Niedermayer [Sun, 26 Feb 2017 19:28:01 +0000 (20:28 +0100)]
avcodec/h264idct_template: Fix multiple runtime error: signed integer overflow

Fixes: 677/clusterfuzz-testcase-6635120628858880

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Reviewed-by: Steven Liu <lingjiujianke@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/qdrw: check bytes per scanline for 2bpp images
Paul B Mahol [Mon, 27 Feb 2017 13:15:11 +0000 (14:15 +0100)]
avcodec/qdrw: check bytes per scanline for 2bpp images

One byte less is read in case of small width.
Closes #6194.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
3 years agoavcodec/scpr: check if total_freq is 0 in decode0
Paul B Mahol [Mon, 27 Feb 2017 12:50:08 +0000 (13:50 +0100)]
avcodec/scpr: check if total_freq is 0 in decode0

Fixes SIGFPE, closes #6196.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
3 years agoavcodec/h264: enable sse2 chroma deblock/loop filter functions
James Darnley [Wed, 22 Feb 2017 00:17:06 +0000 (01:17 +0100)]
avcodec/h264: enable sse2 chroma deblock/loop filter functions

Between 1.00 and 1.16 times faster on Intel Yorkfield Core 2 Quad.
Between 1.11 and 1.39 times faster on Intel Kaby Lake Pentium.

3 years agoavcodec/h264: add avx 8-bit 4:2:2 chroma h intra deblock/loop filter
James Darnley [Wed, 15 Feb 2017 14:05:42 +0000 (15:05 +0100)]
avcodec/h264: add avx 8-bit 4:2:2 chroma h intra deblock/loop filter

~1.37x faster (147 vs. 108 cycles) compared to mmxext function

3 years agoavcodec/h264: add avx 8-bit 4:2:0 chroma h intra deblock/loop filter
James Darnley [Wed, 15 Feb 2017 14:03:18 +0000 (15:03 +0100)]
avcodec/h264: add avx 8-bit 4:2:0 chroma h intra deblock/loop filter

~1.10x faster (69 vs. 63 cycles) compared to mmxext function

3 years agoavcodec/h264: add avx 8-bit chroma v intra deblock/loop filter
James Darnley [Wed, 15 Feb 2017 13:59:46 +0000 (14:59 +0100)]
avcodec/h264: add avx 8-bit chroma v intra deblock/loop filter

~1.14x faster (90 vs 78 cycles) compared with mmxext

3 years agoavcodec/h264: add avx 8-bit 4:2:2 chroma h deblock/loop filter
James Darnley [Wed, 15 Feb 2017 13:54:11 +0000 (14:54 +0100)]
avcodec/h264: add avx 8-bit 4:2:2 chroma h deblock/loop filter

~1.21x faster (68 vs. 56 cycles) compared with mmxext function

3 years agoavcodec/h264: add avx 8-bit 4:2:0 chroma h deblock/loop filter
James Darnley [Wed, 15 Feb 2017 13:48:13 +0000 (14:48 +0100)]
avcodec/h264: add avx 8-bit 4:2:0 chroma h deblock/loop filter

~1.14x faster (93 vs. 81 cycles) compared with mmxext function

3 years agoavcodec/h264: add avx 8-bit chroma v deblock/loop filter
James Darnley [Wed, 15 Feb 2017 13:36:20 +0000 (14:36 +0100)]
avcodec/h264: add avx 8-bit chroma v deblock/loop filter

~1.24x faster (101 vs. 81 cycles) compared with mmxext function

3 years agolavc/svq3: Remove an unused function.
Carl Eugen Hoyos [Mon, 27 Feb 2017 12:10:41 +0000 (13:10 +0100)]
lavc/svq3: Remove an unused function.

3 years agoavcodec/qdrw: consume bytes when end is reached for 8bpp case
Paul B Mahol [Mon, 27 Feb 2017 11:04:15 +0000 (12:04 +0100)]
avcodec/qdrw: consume bytes when end is reached for 8bpp case

This should really be part of previous commit.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
3 years agoavcodec/qdrw: fix decoding of odd sized images for 8bpp
Paul B Mahol [Mon, 27 Feb 2017 10:49:59 +0000 (11:49 +0100)]
avcodec/qdrw: fix decoding of odd sized images for 8bpp

Signed-off-by: Paul B Mahol <onemda@gmail.com>
3 years agoavcodec/qdrw: fix decoding odd size images for 2bpp and 4bpp
Paul B Mahol [Mon, 27 Feb 2017 10:39:36 +0000 (11:39 +0100)]
avcodec/qdrw: fix decoding odd size images for 2bpp and 4bpp

Signed-off-by: Paul B Mahol <onemda@gmail.com>
3 years agoavcodec/qdrw: fix decoding odd size images for 16bit case
Paul B Mahol [Mon, 27 Feb 2017 10:24:43 +0000 (11:24 +0100)]
avcodec/qdrw: fix decoding odd size images for 16bit case

Signed-off-by: Paul B Mahol <onemda@gmail.com>
3 years agoffmpeg: Add a linebreak to an error message.
Carl Eugen Hoyos [Mon, 27 Feb 2017 09:28:00 +0000 (10:28 +0100)]
ffmpeg: Add a linebreak to an error message.

3 years agoavdevice/decklink_dec: remove AVFMT_RAWPICTURE
Marton Balint [Sat, 18 Feb 2017 17:18:18 +0000 (18:18 +0100)]
avdevice/decklink_dec: remove AVFMT_RAWPICTURE

It has no effect for input devices.

Signed-off-by: Marton Balint <cus@passwd.hu>
3 years agoavdevice/decklink_enc: convert AVFMT_RAWPICTURE to AV_CODEC_ID_WRAPPED_AVFRAME
Marton Balint [Sat, 18 Feb 2017 02:13:56 +0000 (03:13 +0100)]
avdevice/decklink_enc: convert AVFMT_RAWPICTURE to AV_CODEC_ID_WRAPPED_AVFRAME

Signed-off-by: Marton Balint <cus@passwd.hu>
3 years agoavdevice/decklink_enc: add support to specify field order
Marton Balint [Sat, 18 Feb 2017 01:33:05 +0000 (02:33 +0100)]
avdevice/decklink_enc: add support to specify field order

Signed-off-by: Marton Balint <cus@passwd.hu>
3 years agoavdevice/decklink_enc: convert to codecpar
Marton Balint [Fri, 17 Feb 2017 20:53:00 +0000 (21:53 +0100)]
avdevice/decklink_enc: convert to codecpar

Signed-off-by: Marton Balint <cus@passwd.hu>
3 years agoavcodec/scpr: add support for older version
Paul B Mahol [Sun, 26 Feb 2017 21:05:13 +0000 (22:05 +0100)]
avcodec/scpr: add support for older version

Signed-off-by: Paul B Mahol <onemda@gmail.com>
3 years agoavcodec/flacdsp: Fix: runtime error: signed integer overflow: -1027555328 + -12266812...
Michael Niedermayer [Sat, 25 Feb 2017 20:07:26 +0000 (21:07 +0100)]
avcodec/flacdsp: Fix: runtime error: signed integer overflow: -1027555328 + -1226681270 cannot be represented in type 'int'

Fixes: 673/clusterfuzz-testcase-5948736536576000

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/eac3dec: Fix runtime error: left shift of negative value -3
Michael Niedermayer [Sat, 25 Feb 2017 20:07:25 +0000 (21:07 +0100)]
avcodec/eac3dec: Fix runtime error: left shift of negative value -3

Fixes: 672/clusterfuzz-testcase-5595018867769344

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/mpeg12dec: Fix runtime error: left shift of negative value -2
Michael Niedermayer [Sat, 25 Feb 2017 20:07:24 +0000 (21:07 +0100)]
avcodec/mpeg12dec: Fix runtime error: left shift of negative value -2

671/clusterfuzz-testcase-4990381827555328

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/ituh263dec: Check for the bitstream end in ff_h263_decode_mb()
Michael Niedermayer [Sat, 25 Feb 2017 20:07:23 +0000 (21:07 +0100)]
avcodec/ituh263dec: Check for the bitstream end in ff_h263_decode_mb()

Fixes invalid shift

Fixes: 670/clusterfuzz-testcase-4852021066727424

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoadd locale month names to av_small_strptime
Micah Galizia [Wed, 22 Feb 2017 01:37:25 +0000 (20:37 -0500)]
add locale month names to av_small_strptime

Signed-off-by: Micah Galizia <micahgalizia@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agofate: update ffprobe stuff after dbc7f02a727286f3
Paul B Mahol [Sun, 26 Feb 2017 16:05:43 +0000 (17:05 +0100)]
fate: update ffprobe stuff after dbc7f02a727286f3

Signed-off-by: Paul B Mahol <onemda@gmail.com>
3 years agoavutil/frame: Disallow zero sized frame side data
Michael Niedermayer [Thu, 23 Feb 2017 14:19:32 +0000 (15:19 +0100)]
avutil/frame: Disallow zero sized frame side data

There should be no case that needs this and its a potential for
creating corner cases

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavutil/frame: Reimplement av_frame_new_side_data() without size=0 special case
Michael Niedermayer [Thu, 23 Feb 2017 14:19:31 +0000 (15:19 +0100)]
avutil/frame: Reimplement av_frame_new_side_data() without size=0 special case

The size 0 special case causes side data to be created which is
different and a special case if for any reasons size = 0 is passed

Fixes: multiple runtime error: null pointer passed as argument 1, which is declared to never be null
Fixes: 653/clusterfuzz-testcase-5773837415219200

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/wavpack: Fix 280:22: runtime error: left shift of negative value -1
Michael Niedermayer [Thu, 23 Feb 2017 14:19:30 +0000 (15:19 +0100)]
avcodec/wavpack: Fix 280:22: runtime error: left shift of negative value -1

Fixes: 653/clusterfuzz-testcase-5773837415219200
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/wavpack: Check post_shift
Michael Niedermayer [Thu, 23 Feb 2017 14:19:29 +0000 (15:19 +0100)]
avcodec/wavpack: Check post_shift

Fixes: runtime error: shift exponent 34 is too large for 32-bit type 'int'

Fixes: 653/clusterfuzz-testcase-5773837415219200

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavfilter/aeval: trim last frame's number of samples to match requested duration
Paul B Mahol [Fri, 24 Feb 2017 17:50:09 +0000 (18:50 +0100)]
avfilter/aeval: trim last frame's number of samples to match requested duration

Fixes #6181.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
3 years agolswr/rematrix: Remove an aggressive loop optimization.
Carl Eugen Hoyos [Fri, 24 Feb 2017 10:16:26 +0000 (11:16 +0100)]
lswr/rematrix: Remove an aggressive loop optimization.

Fixes undefined behaviour and a gcc warning:
libswresample/rematrix.c:376:47: warning: iteration 64 invokes undefined behavior

3 years agoavcodec/vp56: Implement very basic error concealment
Michael Niedermayer [Sat, 25 Feb 2017 11:37:32 +0000 (12:37 +0100)]
avcodec/vp56: Implement very basic error concealment

This should fix the fate failure due to a truncated last frame.
Alternatively the frame could be dropped.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/hlsenc: don't use %s for strftime on msvc
Hendrik Leppkes [Sat, 25 Feb 2017 03:23:50 +0000 (11:23 +0800)]
avformat/hlsenc: don't use %s for strftime on msvc

MSVC doesn't support the %s time format, and instead of returning an
error the invalid parameter handler is invoked which (by default)
terminates the process.

Reviewed-by:Steven Liu <lq@chinaffmpeg.org>
Signed-off-by: Hendrik Leppkes <h.leppkes@gmail.com>
3 years agoavformat/hlsenc: fix hls_flags temp_file bug
Steven Liu [Sat, 25 Feb 2017 02:59:05 +0000 (10:59 +0800)]
avformat/hlsenc: fix hls_flags temp_file bug

refer to ticket id: #6170

rename file from temp to origin name after complete current segment

Reviewed-by: Aman Gupta <ffmpeg@tmm1.net>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
3 years agoavcodec/amrwbdec: Fix 2 runtime errors: left shift of negative value -1
Michael Niedermayer [Sat, 25 Feb 2017 01:19:43 +0000 (02:19 +0100)]
avcodec/amrwbdec: Fix 2 runtime errors: left shift of negative value -1

Fixes: 669/clusterfuzz-testcase-4847965409640448

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/pngdec: Fix runtime error: left shift of 152 by 24 places cannot be represent...
Michael Niedermayer [Sat, 25 Feb 2017 00:43:16 +0000 (01:43 +0100)]
avcodec/pngdec: Fix runtime error: left shift of 152 by 24 places cannot be represented in type 'int'

Fixes: 666/clusterfuzz-testcase-6581447227867136

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/vp56: Fix sign typo
Michael Niedermayer [Fri, 24 Feb 2017 20:05:33 +0000 (21:05 +0100)]
avcodec/vp56: Fix sign typo

Fixes: 664/clusterfuzz-testcase-4917047475568640

The change to fate is due to a truncated last frames which is now detected as damaged.

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/mpegaudiodec_template: Correct return code on id3 tag discarding
Michael Niedermayer [Fri, 24 Feb 2017 18:04:12 +0000 (19:04 +0100)]
avcodec/mpegaudiodec_template: Correct return code on id3 tag discarding

Fixes: 665/clusterfuzz-testcase-4863789881098240

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoopus_pvq: prevent division by 0
Rostislav Pehlivanov [Fri, 24 Feb 2017 19:13:44 +0000 (19:13 +0000)]
opus_pvq: prevent division by 0

res was 0 and divided K which made it infinity which caused K to
overflow.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
3 years agoavcodec/scpr: remove 4 dead store
Paul B Mahol [Fri, 24 Feb 2017 18:49:39 +0000 (19:49 +0100)]
avcodec/scpr: remove 4 dead store

Signed-off-by: Paul B Mahol <onemda@gmail.com>
3 years agoavcodec/fmvc: initialize opcode to 0
Paul B Mahol [Fri, 24 Feb 2017 14:50:16 +0000 (15:50 +0100)]
avcodec/fmvc: initialize opcode to 0

It shouldn't really matter but it doesn't hurt.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
3 years agoavcodec/scpr: improve motion vectors checking for out of buffer write
Paul B Mahol [Fri, 24 Feb 2017 14:27:19 +0000 (15:27 +0100)]
avcodec/scpr: improve motion vectors checking for out of buffer write

Signed-off-by: Paul B Mahol <onemda@gmail.com>
3 years agotools/target_dec_fuzzer: Fix misaligned read
Michael Niedermayer [Fri, 24 Feb 2017 12:23:37 +0000 (13:23 +0100)]
tools/target_dec_fuzzer: Fix misaligned read

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/vp3dsp: Fix multiple signed integer overflow: 46341 * 47523 cannot be represe...
Michael Niedermayer [Fri, 24 Feb 2017 12:11:43 +0000 (13:11 +0100)]
avcodec/vp3dsp: Fix multiple signed integer overflow: 46341 * 47523 cannot be represented in type 'int'

Fixes: 664/clusterfuzz-testcase-4917047475568640

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/rv34: Simplify and factor get_slice_offset() code
Michael Niedermayer [Fri, 24 Feb 2017 11:46:28 +0000 (12:46 +0100)]
avcodec/rv34: Simplify and factor get_slice_offset() code

This also fixes several integer overflows by checking each value before
use.
Fixes: 662/clusterfuzz-testcase-4898131432964096

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/scpr: make sure that component value is <= 0x1F for 16 bpc
Paul B Mahol [Fri, 24 Feb 2017 11:01:30 +0000 (12:01 +0100)]
avcodec/scpr: make sure that component value is <= 0x1F for 16 bpc

Signed-off-by: Paul B Mahol <onemda@gmail.com>
3 years agoavcodec/aic: unbreak decoding of files with slice_width != 16
Paul B Mahol [Fri, 24 Feb 2017 10:29:42 +0000 (11:29 +0100)]
avcodec/aic: unbreak decoding of files with slice_width != 16

Signed-off-by: Paul B Mahol <onemda@gmail.com>
3 years agolavc/utils: Make second parameter to apply_param_change() const.
Carl Eugen Hoyos [Fri, 24 Feb 2017 01:18:23 +0000 (02:18 +0100)]
lavc/utils: Make second parameter to apply_param_change() const.

Fixes a compilation warning:
passing argument 2 of ‘apply_param_change’ discards ‘const’ qualifier from pointer target type

3 years agoopus_pvq: remove unneeded assert
Rostislav Pehlivanov [Fri, 24 Feb 2017 07:06:59 +0000 (07:06 +0000)]
opus_pvq: remove unneeded assert

Since the PVQ search has been well fuzzed and is guaranteed to never
break SUM(abs(y[])) == K, the assert is no longer needed.
Also the assert only prevented coding the wrong vector index but didn't
prevent crashes during searching for it, which made the assert rather
informational than practical.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
3 years agoopus_pvq: improve PVQ search for low Ks
Rostislav Pehlivanov [Fri, 24 Feb 2017 07:03:12 +0000 (07:03 +0000)]
opus_pvq: improve PVQ search for low Ks

Since the probelm mentioned only happened when the phase was negative
(e.g. the sum had to be decreased), only discarding dimensions with a
zero pulse in that case restored the search's previously low distortion
at low Ks when the phase is never negative.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
3 years agoavcodec/ituh263dec: Fix runtime error: left shift of 1342177279 by 1 places cannot...
Michael Niedermayer [Thu, 23 Feb 2017 22:46:30 +0000 (23:46 +0100)]
avcodec/ituh263dec: Fix runtime error: left shift of 1342177279 by 1 places cannot be represented in type 'int'

Fixes: 659/clusterfuzz-testcase-5866673603084288

Huge DMV could be created by an encoder ignoring the spec

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/jpeglsdec: check shift for values that cause overflow later
Michael Niedermayer [Thu, 23 Feb 2017 22:13:24 +0000 (23:13 +0100)]
avcodec/jpeglsdec: check shift for values that cause overflow later

Fixes: 657/clusterfuzz-testcase-6674741433729024
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/mpeg4videodec: Check the other 3 sprite points for intermediate overflows
Michael Niedermayer [Thu, 23 Feb 2017 21:33:16 +0000 (22:33 +0100)]
avcodec/mpeg4videodec: Check the other 3 sprite points for intermediate overflows

This is not necessarily specific to fuzzed files

Fixes: Multiple integer overflows
Fixes: 656/clusterfuzz-testcase-6463814516080640
Fixes: 658/clusterfuzz-testcase-6691260146384896

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>