ffmpeg.git
3 years agoMerge commit 'e25cac50e05d29a15d7a52c01c394ba913c97aee'
Derek Buitenhuis [Thu, 19 Nov 2015 14:08:42 +0000 (14:08 +0000)]
Merge commit 'e25cac50e05d29a15d7a52c01c394ba913c97aee'

* commit 'e25cac50e05d29a15d7a52c01c394ba913c97aee':
  lavc: Add missing mem.h header to libxvid and screenpresso

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
3 years agoMerge commit '73b03249133d6631520089798087cbd963eed9ca'
Derek Buitenhuis [Thu, 19 Nov 2015 14:07:23 +0000 (14:07 +0000)]
Merge commit '73b03249133d6631520089798087cbd963eed9ca'

* commit '73b03249133d6631520089798087cbd963eed9ca':
  aiff: Support demuxing G.722 streams

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
3 years agoavcodec/aacsbr: Replace a noise_facs_q check by an av_assert0
Michael Niedermayer [Thu, 19 Nov 2015 12:32:40 +0000 (13:32 +0100)]
avcodec/aacsbr: Replace a noise_facs_q check by an av_assert0

The replaced check should have become redundant

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/aacsbr_template: Check values read in read_sbr_noise()
Michael Niedermayer [Thu, 19 Nov 2015 12:00:27 +0000 (13:00 +0100)]
avcodec/aacsbr_template: Check values read in read_sbr_noise()

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/aacsbr: Split pre dequantization noise factors table
Michael Niedermayer [Thu, 19 Nov 2015 11:03:22 +0000 (12:03 +0100)]
avcodec/aacsbr: Split pre dequantization noise factors table

This allows removing a special case for the fixed point decoder and will
make error checks simpler

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/pthread_slice: remove dummy_ret hack
Michael Niedermayer [Wed, 18 Nov 2015 23:28:05 +0000 (00:28 +0100)]
avcodec/pthread_slice: remove dummy_ret hack

This should avoid some tsan warnings

Found-by: Chris Cunningham <chcunningham@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agomxfdec: check edit_rate also for physical_track
Andreas Cadhalpun [Sun, 15 Nov 2015 16:46:08 +0000 (17:46 +0100)]
mxfdec: check edit_rate also for physical_track

Previously only the edit_rate of material_track was checked.
If it's negative, it causes assertion failures in av_rescale_rnd.

Reviewed-by: Tim Nicholson <nichot20-at-yahoo.com@ffmpeg.org>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
3 years agoavcodec/h264_slice: Clear top_borders on allocation
Michael Niedermayer [Wed, 18 Nov 2015 13:20:07 +0000 (14:20 +0100)]
avcodec/h264_slice: Clear top_borders on allocation

In case of bitstream errors the deblock filter and slices can access uninitialized
top_borders from previous slices which did not fill them as they stoped halfway due
to error or where entirely missing.

This also makes code using these tables deterministic in case of missing or damaged
slices

Found-by: Tyson Smith
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavutil/mem: Add av_fast_mallocz()
Michael Niedermayer [Wed, 18 Nov 2015 13:19:47 +0000 (14:19 +0100)]
avutil/mem: Add av_fast_mallocz()

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoMerge commit '5f2c8315b3c1b28da0386fddb118ad6a0ed77a0c'
Derek Buitenhuis [Wed, 18 Nov 2015 16:46:57 +0000 (16:46 +0000)]
Merge commit '5f2c8315b3c1b28da0386fddb118ad6a0ed77a0c'

This is a no-op.

* commit '5f2c8315b3c1b28da0386fddb118ad6a0ed77a0c':
  thp: set duration for audio stream too

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
3 years agoMerge commit '1d62ee38894afb696674db78cee8f8d89204a8fe'
Derek Buitenhuis [Wed, 18 Nov 2015 16:41:04 +0000 (16:41 +0000)]
Merge commit '1d62ee38894afb696674db78cee8f8d89204a8fe'

* commit '1d62ee38894afb696674db78cee8f8d89204a8fe':
  movenc: Add a unit test for signaling of the track start times

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
3 years agoMerge commit 'bef3b1f59f036aba4a5fe599b2480f6bd9e6b280'
Derek Buitenhuis [Wed, 18 Nov 2015 16:40:16 +0000 (16:40 +0000)]
Merge commit 'bef3b1f59f036aba4a5fe599b2480f6bd9e6b280'

* commit 'bef3b1f59f036aba4a5fe599b2480f6bd9e6b280':
  movenc: Allow setting start_dts/start_cts before writing actual packets

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
3 years agomovenc-test: Pad the packet data start with 0s
Derek Buitenhuis [Tue, 17 Nov 2015 15:58:51 +0000 (15:58 +0000)]
movenc-test: Pad the packet data start with 0s

This way, it never starts with 0xFFF0, and never trips the
ADTS "Detection" code in movenc.c.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
3 years agoavformat/genh: Fix tools/probetest failure
Michael Niedermayer [Tue, 17 Nov 2015 16:01:58 +0000 (17:01 +0100)]
avformat/genh: Fix tools/probetest failure

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/dashenc: Add framerate to dash manifest
Bryan Huh [Wed, 18 Nov 2015 09:13:14 +0000 (01:13 -0800)]
avformat/dashenc: Add framerate to dash manifest

DASH manifest should have framerate specified as an attribute in the
AdaptationSet element and Representation elements. Though ISO/IEC
23009-1:2014 doesn't seem to define frameRate as a required attribute,
it is at least optional, and DASH-IF IOP 3.0 seems to require it. See
section 3.2.4 of http://dashif.org/w/2015/04/DASH-IF-IOP-v3.0.pdf

In the event that avg_frame_rate is not set in the muxer, we ignore the
frameRate tag altogther.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat: add IVR demuxer
Paul B Mahol [Wed, 11 Nov 2015 21:04:57 +0000 (22:04 +0100)]
avformat: add IVR demuxer

Signed-off-by: Paul B Mahol <onemda@gmail.com>
3 years agoavcodec/faandct: use typedef instead of #define
Ganesh Ajjanagadde [Fri, 13 Nov 2015 16:17:08 +0000 (11:17 -0500)]
avcodec/faandct: use typedef instead of #define

See e.g https://stackoverflow.com/questions/1666353/are-typedef-and-define-the-same-in-c
for rationale.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
3 years agoavformat/rtpdec_mpa_robust: change assignment to inequality test in conditional
Ganesh Ajjanagadde [Tue, 27 Oct 2015 23:54:07 +0000 (19:54 -0400)]
avformat/rtpdec_mpa_robust: change assignment to inequality test in conditional

In the spirit of commit 8199908fdf9b3797cceaea9d1e2fc09d02ef7309, likely
typo originally.

Found by enabling -Wparentheses on clang 3.7 and running a manual audit.
To the best of my knowledge, no such instances remain.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
3 years agoavformat/matroskadec: Check subtitle stream before dereferencing
Michael Niedermayer [Tue, 17 Nov 2015 17:19:01 +0000 (18:19 +0100)]
avformat/matroskadec: Check subtitle stream before dereferencing

Unrecognized streams are not allocated
Fixes: flicker-1.color1.vp91447030769.08.webm

Found-by: Chris Cunningham <chcunningham@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoMerge commit '3eeb7edfc2a1157b7b0e0ce21ac2cd44d55d405b'
Derek Buitenhuis [Tue, 17 Nov 2015 14:56:55 +0000 (14:56 +0000)]
Merge commit '3eeb7edfc2a1157b7b0e0ce21ac2cd44d55d405b'

* commit '3eeb7edfc2a1157b7b0e0ce21ac2cd44d55d405b':
  movenc: Add a unit test for frag_discont with edit lists

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
3 years agoMerge commit '09e431b9e3674804172e7b0a0f865b65ec09739a'
Derek Buitenhuis [Tue, 17 Nov 2015 14:55:22 +0000 (14:55 +0000)]
Merge commit '09e431b9e3674804172e7b0a0f865b65ec09739a'

* commit '09e431b9e3674804172e7b0a0f865b65ec09739a':
  movenc: Assume streams starting at pts=0 for discontinuous fragments with editlists

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
3 years agoavcodec/internal: Fix skiped typo
Michael Niedermayer [Mon, 16 Nov 2015 18:36:57 +0000 (19:36 +0100)]
avcodec/internal: Fix skiped typo

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agofate: update fate-source reference file
James Almer [Tue, 17 Nov 2015 00:12:01 +0000 (21:12 -0300)]
fate: update fate-source reference file

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavformat/movenc-test: fix copyright header
James Almer [Mon, 16 Nov 2015 23:54:30 +0000 (20:54 -0300)]
avformat/movenc-test: fix copyright header

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavcodec/pngdec: Replace assert by request for sample for unsupported TRNS cases
Michael Niedermayer [Mon, 16 Nov 2015 17:34:44 +0000 (18:34 +0100)]
avcodec/pngdec: Replace assert by request for sample for unsupported TRNS cases

Fixes assertion failure
Fixes: 7f646252a30ee28b583aac1f82e7985e/signal_sigabrt_7ffff6ae7cc9_7353_62fc077bf2f454d39e188c69807193a6.png

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agofate: fix concat demuxer extended test portability
Marton Balint [Mon, 16 Nov 2015 12:19:40 +0000 (13:19 +0100)]
fate: fix concat demuxer extended test portability

Sed \r is not portable, it does not work on freebsd, hopefully tr -d will.

Signed-off-by: Marton Balint <cus@passwd.hu>
3 years agoMerge commit '59e8ec0aa8ab174701d01a3bfe96fedd0b7fcead'
Derek Buitenhuis [Mon, 16 Nov 2015 16:18:42 +0000 (16:18 +0000)]
Merge commit '59e8ec0aa8ab174701d01a3bfe96fedd0b7fcead'

All diferences in unit tests have been acounted for.

* commit '59e8ec0aa8ab174701d01a3bfe96fedd0b7fcead':
  movenc: Add an API unit test for fragmenting options/calls

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
3 years agoavformat/mov: remove redundant assignment
Ganesh Ajjanagadde [Mon, 16 Nov 2015 01:58:46 +0000 (20:58 -0500)]
avformat/mov: remove redundant assignment

This is possibly undefined behavior based on sequence point rules, but I
have not studied the spec at that level of detail.

Fixes: CID 1338321.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
3 years agoavformat/mov: fix memory leak
Ganesh Ajjanagadde [Mon, 16 Nov 2015 01:12:20 +0000 (20:12 -0500)]
avformat/mov: fix memory leak

Fixes: CID 1338328.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
3 years agoavformat/aviobuf: Simplify avio_read() and avio_seek()
Bryan Huh [Mon, 16 Nov 2015 02:02:11 +0000 (18:02 -0800)]
avformat/aviobuf: Simplify avio_read() and avio_seek()

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/aviobuf: Improve readability of aviobuf (Add comments and docs)
Bryan Huh [Mon, 16 Nov 2015 02:02:11 +0000 (18:02 -0800)]
avformat/aviobuf: Improve readability of aviobuf (Add comments and docs)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agofate: fix concat demuxer extended tests on windows
Marton Balint [Mon, 16 Nov 2015 00:25:19 +0000 (01:25 +0100)]
fate: fix concat demuxer extended tests on windows

Line endings do matter to md5sum...

Signed-off-by: Marton Balint <cus@passwd.hu>
3 years agofate: fix concat demuxer tests on msys/cygwin by using relative paths
Marton Balint [Mon, 16 Nov 2015 00:25:18 +0000 (01:25 +0100)]
fate: fix concat demuxer tests on msys/cygwin by using relative paths

Signed-off-by: Marton Balint <cus@passwd.hu>
3 years agoffmpeg: Simplify fps code related to delta0
Bryan Huh [Sun, 15 Nov 2015 02:26:30 +0000 (18:26 -0800)]
ffmpeg: Simplify fps code related to delta0

Small refactor of fps code for improved readability. In particular
the "cor" variable was unnecessary and misleading because it would
always be set to -delta0.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoffmpeg: Fixing typos and adding comments to fps code
Bryan Huh [Sun, 15 Nov 2015 02:23:20 +0000 (18:23 -0800)]
ffmpeg: Fixing typos and adding comments to fps code

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agompegtsenc: add vc-1 support to MPEG-TS muxer (ticket 2141)
Hagen Schmidt [Thu, 12 Nov 2015 21:54:18 +0000 (22:54 +0100)]
mpegtsenc: add vc-1 support to MPEG-TS muxer (ticket 2141)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/utils: Do not init parser if probing is unfinished
Michael Niedermayer [Sun, 15 Nov 2015 22:41:14 +0000 (23:41 +0100)]
avformat/utils: Do not init parser if probing is unfinished

Fixes assertion failure
Fixes: 136f8b8d47af7892306625e597dee655/signal_sigabrt_7ffff6ae7cc9_8941_ab11bea57c84796418f481f873dc31ba.dvr_ms

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/jpeg2000: Change coord to 32bit to support larger than 32k width or height
Michael Niedermayer [Sun, 15 Nov 2015 21:05:04 +0000 (22:05 +0100)]
avcodec/jpeg2000: Change coord to 32bit to support larger than 32k width or height

Fixes: 03e0abe721b1174856d41a1eb5d6a896/signal_sigabrt_7ffff6ae7cc9_3813_e71bf3541abed3ccba031cd5ba0269a4.avi

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/jpeg2000dec: Fix potential integer overflow with tile dimensions
Michael Niedermayer [Sun, 15 Nov 2015 20:17:05 +0000 (21:17 +0100)]
avcodec/jpeg2000dec: Fix potential integer overflow with tile dimensions

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/jpeg2000dec: Check SIZ dimensions to be within the supported range
Michael Niedermayer [Sun, 15 Nov 2015 20:12:50 +0000 (21:12 +0100)]
avcodec/jpeg2000dec: Check SIZ dimensions to be within the supported range

Fixes potential integer overflows
Fixes: 03e0abe721b1174856d41a1eb5d6a896/signal_sigabrt_7ffff6ae7cc9_3813_e71bf3541abed3ccba031cd5ba0269a4.avi

This fix is choosen to be simple to backport, better solution
for master is planed

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/jpeg2000: Check comp coords to be within the supported size
Michael Niedermayer [Sun, 15 Nov 2015 19:49:17 +0000 (20:49 +0100)]
avcodec/jpeg2000: Check comp coords to be within the supported size

Fixes assertion failure
Fixes: 03e0abe721b1174856d41a1eb5d6a896/signal_sigabrt_7ffff6ae7cc9_3813_e71bf3541abed3ccba031cd5ba0269a4.avi

This fix is choosen to be simple to backport, better solution
for master is planed

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/jpeg2000: Use av_image_check_size() in ff_jpeg2000_init_component()
Michael Niedermayer [Sun, 15 Nov 2015 19:03:39 +0000 (20:03 +0100)]
avcodec/jpeg2000: Use av_image_check_size() in ff_jpeg2000_init_component()

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agofate: add concat demuxer tests
Marton Balint [Sat, 24 Oct 2015 13:39:18 +0000 (15:39 +0200)]
fate: add concat demuxer tests

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Marton Balint <cus@passwd.hu>
3 years agoavcodec/wmaprodec: Check for overread in decode_packet()
Michael Niedermayer [Sun, 15 Nov 2015 17:18:40 +0000 (18:18 +0100)]
avcodec/wmaprodec: Check for overread in decode_packet()

Fixes assertion failure
Fixes: 0256e92df2df7e933b43a2c70e4c8040/signal_sigabrt_7ffff6ae7cc9_1358_999ac18684788221490757582ce9af84.wma

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoswresample/resample: remove redundant L for floating literal
Ganesh Ajjanagadde [Sun, 15 Nov 2015 15:12:55 +0000 (10:12 -0500)]
swresample/resample: remove redundant L for floating literal

It is inherently double precision, and 1.0 is perfectly represented
anyway.

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
3 years agoavcodec/faandct: use more accurate constants
Ganesh Ajjanagadde [Fri, 13 Nov 2015 16:19:33 +0000 (11:19 -0500)]
avcodec/faandct: use more accurate constants

This guarantees a "best effort precision".

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
3 years agoavformat/utils: estimate_timings_from_pts - increase retry counter, fixes invalid...
Rainer Hochecker [Sun, 15 Nov 2015 12:58:50 +0000 (13:58 +0100)]
avformat/utils: estimate_timings_from_pts - increase retry counter, fixes invalid duration for ts files with hevc codec

Fixes a mpegts file with hevc that fails estimating duration. Increasing number of
retries fixes the issue.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/smacker: Check that the data size is a multiple of a sample vector
Michael Niedermayer [Sun, 15 Nov 2015 13:52:08 +0000 (14:52 +0100)]
avcodec/smacker: Check that the data size is a multiple of a sample vector

Fixes out of array access
Fixes: ce19e41f0ef1e52a23edc488faecdb58/asan_heap-oob_2504e97_4202_ffa0df1baed14022b9bfd4f8ac23d0cb.smk

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agompegvideo: clear overread in clear_context
Andreas Cadhalpun [Sat, 14 Nov 2015 21:46:46 +0000 (22:46 +0100)]
mpegvideo: clear overread in clear_context

Otherwise the h263p decoder can try to copy overread bytes, even though
buffer is NULL.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
3 years agolavc/pngdec: set FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM capability
Matthieu Bouron [Mon, 2 Nov 2015 09:34:20 +0000 (10:34 +0100)]
lavc/pngdec: set FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM capability

3 years agolavc/mjpegdec: set FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM capability
Matthieu Bouron [Mon, 2 Nov 2015 09:32:51 +0000 (10:32 +0100)]
lavc/mjpegdec: set FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM capability

3 years agolavc/internal: add FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM
Matthieu Bouron [Mon, 2 Nov 2015 09:27:58 +0000 (10:27 +0100)]
lavc/internal: add FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM

The decoder extracts and fills its parameters even if the frame is
skipped due to the skip_frame setting.

3 years agoavutil: Move av_rint64_clip_* to internal.h
Michael Niedermayer [Sun, 15 Nov 2015 01:35:02 +0000 (02:35 +0100)]
avutil: Move av_rint64_clip_* to internal.h

The function is renamed to ff_rint64_clip()

This should avoid build failures on VS2012
Feel free to changes this to a different solution

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/takdec: Skip last p2 sample (which is unused)
Michael Niedermayer [Sun, 15 Nov 2015 00:22:31 +0000 (01:22 +0100)]
avcodec/takdec: Skip last p2 sample (which is unused)

Fixes out of array read
Fixes: cb3f38b08b4541523974667c7d1eee9e/asan_heap-oob_2659e18_9838_021fd5cd635bf76cede6398cd9ecbcdd.tak

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/dxtory: Fix input size check in dxtory_decode_v1_410()
Michael Niedermayer [Sat, 14 Nov 2015 23:25:11 +0000 (00:25 +0100)]
avcodec/dxtory: Fix input size check in dxtory_decode_v1_410()

Fixes potential out of array read

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/dxtory: Fix input size check in dxtory_decode_v1_420()
Michael Niedermayer [Sat, 14 Nov 2015 23:25:11 +0000 (00:25 +0100)]
avcodec/dxtory: Fix input size check in dxtory_decode_v1_420()

Fixes out of array read
Fixes: c50c4aa6cefda71b19a31ea12302980c/asan_heap-oob_12be5fd_7011_33ebd015a74976215934add72b9c8352.avi

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/error_resilience: avoid accessing previous or next frames tables beyond height
Michael Niedermayer [Sat, 14 Nov 2015 20:11:52 +0000 (21:11 +0100)]
avcodec/error_resilience: avoid accessing previous or next frames tables beyond height

The height of tables can be rounded up for MBAFF but this does not imply that is also true
for the previous frames

Fixes out of array reads
Fixes: c106b36fa36db8ff8f3ed0c82be7bea2/asan_heap-oob_32699f0_6321_467b9a1d7e03d7cfd310b7e65dc53bcc.mov

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agodds: disable palette flag for compressed dds
Andreas Cadhalpun [Fri, 13 Nov 2015 20:48:27 +0000 (21:48 +0100)]
dds: disable palette flag for compressed dds

Having both is not valid and can cause a NULL pointer dereference of
frame->data[1] later.

Reviewed-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
3 years agoavcodec/pgssubdec: Check dimensions for 0
Michael Niedermayer [Sat, 14 Nov 2015 17:06:37 +0000 (18:06 +0100)]
avcodec/pgssubdec: Check dimensions for 0

Fixes division by 0
Fixes: b293a6479bb4b5286cff24d356bfd955/asan_generic_225c3c9_7819_cc526b657450c6cdef1371b526499626.mkv

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/rscc: Check input size for raw mode
Michael Niedermayer [Sat, 14 Nov 2015 16:59:56 +0000 (17:59 +0100)]
avcodec/rscc: Check input size for raw mode

Fixes out of array read
Fixes: 7fcd09eadd046e326d8ea0af66f166c8/asan_heap-oob_4a52e5_2273_fa6078a10dd575df266fb1e0b4114cd5.avi

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/simple_idct: use predefined M_SQRT2
Ganesh Ajjanagadde [Sat, 14 Nov 2015 15:55:10 +0000 (10:55 -0500)]
avcodec/simple_idct: use predefined M_SQRT2

M_SQRT2 is defined in math.h, or in avutil/mathematics.h for
compatibility hacks. This uses this value instead of a floating literal.

Fixed point values produced by C_FIX(), R_FIX() remain identical.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
3 years agoavcodec/mpegaudio: use predefined M_SQRT2
Ganesh Ajjanagadde [Sat, 14 Nov 2015 15:52:30 +0000 (10:52 -0500)]
avcodec/mpegaudio: use predefined M_SQRT2

M_SQRT2 is defined in math.h, or in avutil/mathematics.h for
compatibility hacks. This uses this value instead of an ad-hoc define.

Fixed point values produced by FIX() remain identical.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
3 years agoavcodec/mpegvideo: use predefined M_PI
Ganesh Ajjanagadde [Sat, 14 Nov 2015 15:49:45 +0000 (10:49 -0500)]
avcodec/mpegvideo: use predefined M_PI

M_PI is defined in math.h, or in avutil/mathematics.h for compatibility
hacks. This uses this value instead of an ad-hoc floating literal.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
3 years agoavcodec/ratecontrol: use predefined M_E
Ganesh Ajjanagadde [Wed, 11 Nov 2015 03:26:25 +0000 (22:26 -0500)]
avcodec/ratecontrol: use predefined M_E

M_E is defined in math.h, or in avutil/mathematics.h for compatibility
hacks. This uses this value instead of an ad-hoc define.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
3 years agoavcodec/dpx: Move need_align to act per line
Michael Niedermayer [Sat, 14 Nov 2015 13:29:02 +0000 (14:29 +0100)]
avcodec/dpx: Move need_align to act per line

Fixes out of array read
Fixes: 61cf123c081ee2bb774d307c75bdb99e/asan_heap-oob_1224f76_5546_bee833ffae73f752b489b9eeaac52db7.dpx

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat: implement SChannel SSP TLS protocol
Hendrik Leppkes [Sun, 4 Oct 2015 12:48:49 +0000 (14:48 +0200)]
avformat: implement SChannel SSP TLS protocol

This implementation does not support TLS listen sockets and loading
CA/Certs from files.

The Windows API does not support loading PEM certs, and would either
require a manual loader or instead be limited to loading Windows PFX
certificates

TLS listen sockets would have to be implemented quite separately, as many
of the APIs are different for server-mode (as opposed to client mode).

3 years agoavcodec/flashsv: Check size before updating it
Michael Niedermayer [Sat, 14 Nov 2015 12:34:02 +0000 (13:34 +0100)]
avcodec/flashsv: Check size before updating it

Fixes out of array read
Fixes: 3c857d4d90365731524716e6d051e43a/signal_sigsegv_7f4f59bcc29e_1386_20abd2c8e655cb9c75b24368e65fe3b1.flv

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/ffv1dec: Clear quant_table_count if its invalid
Michael Niedermayer [Sat, 14 Nov 2015 12:21:58 +0000 (13:21 +0100)]
avcodec/ffv1dec: Clear quant_table_count if its invalid

Fixes deallocation of corrupted pointer
Fixes: 343dfbe142a38b521ed069dc4ea7c03b/signal_sigsegv_421427_4074_ffb11959610278cd40dbc153464aa254.avi
No releases affected

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/avrndec: Use the AVFrame format instead of the context
Michael Niedermayer [Sat, 14 Nov 2015 12:04:54 +0000 (13:04 +0100)]
avcodec/avrndec: Use the AVFrame format instead of the context

Fixes out of array read
Fixes: 20dd01398dee0f6d83d7e5410a2ae8eb/signal_sigsegv_39eeb1f_4001_62efbdf1c60748dabf1ec310b59525fd.mov

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavutil/common: add av_rint64_clip
Ganesh Ajjanagadde [Sun, 1 Nov 2015 14:33:29 +0000 (09:33 -0500)]
avutil/common: add av_rint64_clip

The rationale for this function is reflected in the documentation for
it, and is copied here:

Clip a double value into the long long amin-amax range.
This function is needed because conversion of floating point to integers when
it does not fit in the integer's representation does not necessarily saturate
correctly (usually converted to a cvttsd2si on x86) which saturates numbers
> INT64_MAX to INT64_MIN. The standard marks such conversions as undefined
behavior, allowing this sort of mathematically bogus conversions. This provides
a safe alternative that is slower obviously but assures safety and better
mathematical behavior.
API:
@param a value to clip
@param amin minimum value of the clip range
@param amax maximum value of the clip range
@return clipped value

Note that a priori if one can guarantee from the calling side that the
double is in range, it is safe to simply do an explicit/implicit cast,
and that will be far faster. However, otherwise this function should be
used.

avutil minor version is bumped.

Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
3 years agoavcodec/ivi: Check image dimensions
Michael Niedermayer [Sat, 14 Nov 2015 01:36:22 +0000 (02:36 +0100)]
avcodec/ivi: Check image dimensions

Fixes integer overflow
Fixes: 1e32c6c591d940337c20b197ec1c4d3d/asan_heap-oob_4a52e5_8946_0bb0d9e863def56005e49f1d89bdc94d.avi

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/utils: Better check for channels in av_get_audio_frame_duration()
Michael Niedermayer [Sat, 14 Nov 2015 00:35:08 +0000 (01:35 +0100)]
avcodec/utils: Better check for channels in av_get_audio_frame_duration()

Fixes integer overflow
Fixes: 0c2625f236ced104d402b4a03c0d65c7/asan_generic_274e1ce_5990_9314e7a67c26aecf011b178ade9f217c.avi

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/jpeg2000dec: Check for duplicate SIZ marker
Michael Niedermayer [Fri, 13 Nov 2015 23:51:56 +0000 (00:51 +0100)]
avcodec/jpeg2000dec: Check for duplicate SIZ marker

Fixes: 0231a17345734228011c6f35a64e4594/asan_heap-oob_1d92a72_3218_1213809a9e3affec77e4c191fdfdc0a9.mov

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/async: Fix bug where async could not recover after seek to eof
Bryan Huh [Wed, 11 Nov 2015 10:00:21 +0000 (02:00 -0800)]
avformat/async: Fix bug where async could not recover after seek to eof

When async issues its inner seek via ffurl_seek, it treats failures as
EOF being reached. This is not consistent with the behavior of other
protocols (e.g. http, cache) which continue to tolerate reads after
failed seeks, and therefore does not interact correctly with them.

A common pattern where this manifests itself is where avio_seek is
called with pos to be the end-of-file - the http range-request would
fail here, and async would set io_eof_reached to 1. The background
thread would then refuse to read more bytes, and subsequent reads would
only empty the fifo and end in an error.

Presumably the code may have expected subsequent seeks to unset the
io_eof_reached but this is not guaranteed to be true - a subsequent seek
that lands in the AVIOContext's buffer (the fact that the
previously-failed avio_seek leaves the AVIOContext's buffer intact also
suggests that follow-up reads are expected to be tolerated) would not be
issued to the async_seek function, and when that buffer is drained only
async_read calls would follow, leading to the same error just described.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/segafilm: Fix current_sample after seeking and avio_seek return type
Michael Niedermayer [Thu, 12 Nov 2015 22:37:21 +0000 (23:37 +0100)]
avformat/segafilm: Fix current_sample after seeking and avio_seek return type

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/mux: Rename compute_pkt_fields2(), the name is absolutely terrible
Michael Niedermayer [Thu, 12 Nov 2015 22:06:32 +0000 (23:06 +0100)]
avformat/mux: Rename compute_pkt_fields2(), the name is absolutely terrible

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoos2threads: Add pthread_once()
KO Myung-Hun [Thu, 12 Nov 2015 03:31:51 +0000 (12:31 +0900)]
os2threads: Add pthread_once()

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agohevc: Fix a53 caption extraction
Will Kelleher [Wed, 11 Nov 2015 21:37:29 +0000 (15:37 -0600)]
hevc: Fix a53 caption extraction

Just realized my previous patch doesn't work quite right.  I uploaded a better
sample file that actually has visible captions to /incoming/hevc_cc.ts.  I
tested with that file doing hevc->x264 and it works.

This is basically an exact copy of the existing h264 logic.

Signed-off-by: Will Kelleher <wkelleher@gogoair.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavutil/x86/intmath: Fix intrinsic header include when using newer gcc with older...
Matt Oliver [Thu, 12 Nov 2015 05:54:08 +0000 (16:54 +1100)]
avutil/x86/intmath: Fix intrinsic header include when using newer gcc with older icc.

Signed-off-by: Matt Oliver <protogonoi@gmail.com>
3 years agoavutil/x86/bswap: Add msvc bswap instrinsics.
Matt Oliver [Mon, 9 Nov 2015 09:19:32 +0000 (20:19 +1100)]
avutil/x86/bswap: Add msvc bswap instrinsics.

This adds msvc optimisations as well as fixing an error in icl whereby it will generate invalid code otherwise.

Signed-off-by: Matt Oliver <protogonoi@gmail.com>
3 years agolavc: Add missing mem.h header to libxvid and screenpresso
Vittorio Giovara [Mon, 9 Nov 2015 12:28:13 +0000 (13:28 +0100)]
lavc: Add missing mem.h header to libxvid and screenpresso

3 years agoaiff: Support demuxing G.722 streams
Carl Eugen Hoyos [Fri, 6 Nov 2015 23:35:51 +0000 (00:35 +0100)]
aiff: Support demuxing G.722 streams

3 years agothp: set duration for audio stream too
Paul B Mahol [Thu, 5 Nov 2015 11:04:53 +0000 (12:04 +0100)]
thp: set duration for audio stream too

Signed-off-by: Paul B Mahol <onemda@gmail.com>
3 years agomovenc: Add a unit test for signaling of the track start times
Martin Storsjö [Tue, 10 Nov 2015 21:33:44 +0000 (23:33 +0200)]
movenc: Add a unit test for signaling of the track start times

Signed-off-by: Martin Storsjö <martin@martin.st>
3 years agomovenc: Allow setting start_dts/start_cts before writing actual packets
Martin Storsjö [Tue, 3 Nov 2015 20:16:21 +0000 (22:16 +0200)]
movenc: Allow setting start_dts/start_cts before writing actual packets

By writing a zero-sized packet, the caller can communicate the
start_dts/start_cts for the stream without actually writing
the first packet.

This allows doing random-access writing of fragments when the
start dts of the stream isn't zero, so that the edit list in the moov
is written based on timestamps from the nominal start time signaled
via the zero-sized packet, while the first proper packet written
corresponds to a later fragment.

To avoid potential unexpected behaviour, empty packets only set
start_dts if the frag_discont flag is set.

Signed-off-by: Martin Storsjö <martin@martin.st>
3 years agomovenc: Add a unit test for frag_discont with edit lists
Martin Storsjö [Sat, 7 Nov 2015 21:55:32 +0000 (23:55 +0200)]
movenc: Add a unit test for frag_discont with edit lists

This tests the case where the muxer correctly guesses that a stream
starts at pts=0.

Signed-off-by: Martin Storsjö <martin@martin.st>
3 years agomovenc: Assume streams starting at pts=0 for discontinuous fragments with editlists
Martin Storsjö [Mon, 5 Jan 2015 13:13:04 +0000 (15:13 +0200)]
movenc: Assume streams starting at pts=0 for discontinuous fragments with editlists

This allows producing fragments discontinously where the video
stream has b-frames (but starts at pts=0), but doesn't work for the
cases with audio with preroll.

Signed-off-by: Martin Storsjö <martin@martin.st>
3 years agodds: add missing newline to log messages
Andreas Cadhalpun [Tue, 10 Nov 2015 23:37:32 +0000 (00:37 +0100)]
dds: add missing newline to log messages

Reviewed-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
3 years agodds: validate compressed source buffer size
Andreas Cadhalpun [Tue, 10 Nov 2015 23:20:18 +0000 (00:20 +0100)]
dds: validate compressed source buffer size

A too small buffer will cause segfaults somewhere below
decompress_texture_thread.

Reviewed-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
3 years agodds: validate source buffer size before copying
Andreas Cadhalpun [Tue, 10 Nov 2015 23:05:02 +0000 (00:05 +0100)]
dds: validate source buffer size before copying

If it is too small av_image_copy_plane segfaults.

Reviewed-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
3 years agoaacsbr_fixed: check for envelope scalefactors overflowing
Andreas Cadhalpun [Mon, 9 Nov 2015 19:41:16 +0000 (20:41 +0100)]
aacsbr_fixed: check for envelope scalefactors overflowing

This prevents various values from getting an insanely huge exponent.
If someone knows a cleaner solution, thats welcome!

This is similar to commit 8978c74 for aacsbr.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
3 years agoffserver: Replace one malloc(AVStream) by avformat_new_stream()
Michael Niedermayer [Wed, 11 Nov 2015 20:04:01 +0000 (21:04 +0100)]
ffserver: Replace one malloc(AVStream) by avformat_new_stream()

This fixes a null pointer dereference from the recently introduced
AVStream->internal

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoswresample/resample: increase precision for compensation
Michael Niedermayer [Wed, 11 Nov 2015 15:49:21 +0000 (16:49 +0100)]
swresample/resample: increase precision for compensation

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoffmpeg: Fix integer overflow with cur_dts being AV_NOPTS_VALUE
Michael Niedermayer [Wed, 11 Nov 2015 16:19:12 +0000 (17:19 +0100)]
ffmpeg: Fix integer overflow with cur_dts being AV_NOPTS_VALUE

Since de0e219a8aba72de201e85385c746cd1c04be1a2 cur_dts is sometimes invalid

3 years agoffserver: Do not add or rescale AV_NOPTS_VALUE from the demuxer
Michael Niedermayer [Sun, 1 Nov 2015 12:44:59 +0000 (13:44 +0100)]
ffserver: Do not add or rescale AV_NOPTS_VALUE from the demuxer

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoffmpeg: Print a warning if a pkt duration is already set before using the frame rate
Michael Niedermayer [Tue, 10 Nov 2015 21:53:30 +0000 (22:53 +0100)]
ffmpeg: Print a warning if a pkt duration is already set before using the frame rate

I didnt find any case that triggers this but if it gets triggered it needs to be
investigated

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoffmpeg: set muxer packet duration based on framerate only for CFR
Michael Niedermayer [Tue, 10 Nov 2015 21:53:29 +0000 (22:53 +0100)]
ffmpeg: set muxer packet duration based on framerate only for CFR

a set ost->frame_rate does not imply CFR in ffmpeg

The changed fate tests had all wrong packet durations
(like 1/1000 or 1/90000)

There might be more cases in which is_cfr could be set

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoMerge commit '8ad5124b7ecf7f727724e270a7b4bb8c7bcbf6a4'
Hendrik Leppkes [Wed, 11 Nov 2015 14:03:36 +0000 (15:03 +0100)]
Merge commit '8ad5124b7ecf7f727724e270a7b4bb8c7bcbf6a4'

* commit '8ad5124b7ecf7f727724e270a7b4bb8c7bcbf6a4':
  movenc: Automatically flush after writing the initial moov

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
3 years agoMerge commit 'db9b7321d5dfcbaf521d46beec44cf724776c70d'
Hendrik Leppkes [Wed, 11 Nov 2015 14:02:32 +0000 (15:02 +0100)]
Merge commit 'db9b7321d5dfcbaf521d46beec44cf724776c70d'

* commit 'db9b7321d5dfcbaf521d46beec44cf724776c70d':
  vsrc_color: implement frame rate

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
3 years agoMerge commit '1339009c4924a20e872aa62897097bf5d071157c'
Hendrik Leppkes [Wed, 11 Nov 2015 14:01:15 +0000 (15:01 +0100)]
Merge commit '1339009c4924a20e872aa62897097bf5d071157c'

* commit '1339009c4924a20e872aa62897097bf5d071157c':
  vf_showinfo: show timebase & framerate too

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>