1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-24 13:56:33 +02:00

85131 Commits

Author SHA1 Message Date
Ronald S. Bultje
9d742f774a vp8: make wait/thread_mb_pos atomic.
Fixes tsan warnings like this in fate-vp8-test-vector-007:

WARNING: ThreadSanitizer: data race (pid=3590)
  Write of size 4 at 0x7d8c0000e07c by thread T2:
     decode_mb_row_no_filter src/libavcodec/vp8.c:2330 (ffmpeg+0x000000ffb59e)
[..]
  Previous write of size 4 at 0x7d8c0000e07c by thread T1:
     decode_mb_row_no_filter src/libavcodec/vp8.c:2330 (ffmpeg+0x000000ffb59e)

(cherry picked from commit 9a54c6f243412f62bae498ddcac337cb18ae6290)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-04-13 02:29:26 +02:00
Ronald S. Bultje
5e84c94f69 huffyuv: assign correct per-thread avctx pointer to HYuvContext::avctx.
Fixes the following tsan warning when running fate-vsynth_lena-ffvhuff:

WARNING: ThreadSanitizer: data race (pid=6484)
  Write of size 8 at 0x7d64000154b8 by main thread (mutexes: write M1331):
     update_context_from_user src/libavcodec/pthread_frame.c:331 (ffmpeg+0x000000dca887)
[..]
  Previous read of size 8 at 0x7d64000154b8 by thread T2 (mutexes: write M1334):
     draw_slice src/libavcodec/huffyuvdec.c:857 (ffmpeg+0x000000bcc86f)

(cherry picked from commit 7c7e7c44a6eb68eca861e45cb2ce78f582b12c69)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-04-13 02:29:26 +02:00
Ronald S. Bultje
e90de50195 png: set AVFrame flags/fields before calling setup_finished().
Fixes tsan warnings in fate-apng:

WARNING: ThreadSanitizer: data race (pid=51230)
  Read of size 4 at 0x7d50000042fc by main thread (mutexes: write M1000):
     frame_copy_props frame.c:302 (ffmpeg:x86_64+0x1019a35d6)
[..]
  Previous write of size 4 at 0x7d50000042fc by thread T1 (mutexes: write M997):
     decode_idat_chunk pngdec.c:708 (ffmpeg:x86_64+0x100f5562a)

(cherry picked from commit eff2861a757b8a46398e6fcb844b960b4775daad)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-04-13 02:29:26 +02:00
Ronald S. Bultje
51ca6fda05 png: split header state and data state in two separate variables.
Fixes a reported (but false) race condition in tsan for fate-apng:

WARNING: ThreadSanitizer: data race (pid=6274)
  Read of size 4 at 0x7d680001ec78 by main thread (mutexes: write M1338):
     update_thread_context src/libavcodec/pngdec.c:1456 (ffmpeg+0x000000dacf0c)
[..]
  Previous write of size 4 at 0x7d680001ec78 by thread T1 (mutexes: write M1335):
     decode_idat_chunk src/libavcodec/pngdec.c:737 (ffmpeg+0x000000dae951)

(cherry picked from commit 478f1c3d5e5463a284ea7efecfc62d47ba3be11a)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-04-13 02:29:26 +02:00
Ronald S. Bultje
d1cae50a04 hevc: only write to max_ra and pocTid0 in the first slice.
Values from subsequent values are guaranteed to be identical (since
poc and nal_unit_type are checked to be the same between slices), so
this doesn't affect output in any way, but does resolve the remaining
reported race conditions (by tsan) in fate-hevc.

In practice, this fixes tsan warnings like this:

WARNING: ThreadSanitizer: data race (pid=25334)
  Read of size 4 at 0x7d9c0001adcc by main thread (mutexes: write M1386):
     hevc_update_thread_context src/libavcodec/hevcdec.c:3310 (ffmpeg+0x000000b41c7c)
[..]
  Previous write of size 4 at 0x7d9c0001adcc by thread T1 (mutexes: write M1383):
     hls_slice_header src/libavcodec/hevcdec.c:596 (ffmpeg+0x000000b43a22)

(cherry picked from commit 1f50baa2b2da7fdbfccf0662883f38a763ff6619)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-04-13 02:29:26 +02:00
Ronald S. Bultje
b51217381d pthread_frame: call update_context_from_user() after acquiring lock.
Otherwise the thread may still be in the middle of decoding a previous
frame, which would effectively trigger a race condition on any field
concurrently read and written.

In practice, this fixes tsan warnings like the following:

WARNING: ThreadSanitizer: data race (pid=17380)
  Write of size 4 at 0x7d64000160fc by main thread:
     update_context_from_user src/libavcodec/pthread_frame.c:335 (ffmpeg+0x000000dca515)
[..]
  Previous read of size 4 at 0x7d64000160fc by thread T2 (mutexes: write M1821):
     ff_thread_report_progress src/libavcodec/pthread_frame.c:565 (ffmpeg+0x000000dcb08a)

(cherry picked from commit 1269cd5b6f540bef5913bf134d2f461aac50d70b)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-04-13 02:29:26 +02:00
Ronald S. Bultje
f5f0b2f44c ffmpeg: make transcode_init_done atomic.
Should fix tsan warnings in fate-fifo-muxer-h264/wav:

WARNING: ThreadSanitizer: data race (pid=26552)
  Write of size 4 at 0x000001e0d7c0 by main thread:
     transcode_init src/ffmpeg.c:3761 (ffmpeg+0x00000050ca1c)
[..]
  Previous read of size 4 at 0x000001e0d7c0 by thread T1:
     decode_interrupt_cb src/ffmpeg.c:460 (ffmpeg+0x0000004fde19)

(cherry picked from commit 76d8c77430e9e0110623705bfb54d922cc2ac3ea)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-04-13 02:29:26 +02:00
Ronald S. Bultje
e9fc7a90ba h264: don't sync pic_id between threads.
This is how the ref list manager links bitstream IDs to H264Picture/Ref
objects, and is local to the producer thread. There is no need for the
consumer thread to know the bitstream IDs of its references in their
respective producer threads.

In practice, this fixes tsan warnings when running fate-h264:

WARNING: ThreadSanitizer: data race (pid=19295)
  Read of size 4 at 0x7dbc0000e614 by main thread (mutexes: write M1914):
     ff_h264_ref_picture src/libavcodec/h264_picture.c:112 (ffmpeg+0x0000013b3709)
[..]
  Previous write of size 4 at 0x7dbc0000e614 by thread T2 (mutexes: write M1917):
     build_def_list src/libavcodec/h264_refs.c:91 (ffmpeg+0x0000013b46cf)

(cherry picked from commit e72690b18da064f6c0f04f09ccde72b6636e3159)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-04-13 02:29:26 +02:00
Ronald S. Bultje
414d11fff6 h264: don't re-call ff_h264_direct_ref_list_init() w/ frame-mt.
I'm hoping that this will address the remaining tsan fate-h264 issues:

WARNING: ThreadSanitizer: data race (pid=24478)
  Read of size 8 at 0x7dbc0001c828 by main thread (mutexes: write M3243):
     ff_h264_ref_picture src/libavcodec/h264_picture.c:107 (ffmpeg+0x0000013b78d8)
[..]
  Previous write of size 1 at 0x7dbc0001c82e by thread T2 (mutexes: write M3245):
     ff_h264_direct_ref_list_init src/libavcodec/h264_direct.c:137 (ffmpeg+0x000001382c93)

But I'm not sure because I haven't been able to reproduce locally.

(cherry picked from commit 7f05c5cea04112471d8147487aa3b44141922d09)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-04-13 02:29:26 +02:00
James Almer
1830b0a6c7 avformat/movenc: auto insert vp9_superframe bsf when needed
Experimental VP9 support was added to the muxer recently.

Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit d36a3f5a78bb1e15bbaffc7b92dbeb6a50c28ca9)
2017-04-12 20:53:55 -03:00
Carl Eugen Hoyos
0ed4f26cf2 configure: Fix decklink license dependency.
(cherry picked from commit a081acc44082e4124a11747139b9a329fe01736e)
2017-04-12 22:51:03 +02:00
Marton Balint
69e35db80d ffprobe: only use custom logging callback if -show_log is set
The custom callback can cause significant CPU usage on Windows for some large
files with many index entries for some reason.

v2: Move check after parsing options.

Signed-off-by: Marton Balint <cus@passwd.hu>
2017-04-12 21:09:32 +02:00
Marton Balint
af43c7092c tests/fate/filter-video: fix framerate filter tests
Signed-off-by: Marton Balint <cus@passwd.hu>
2017-04-12 21:09:18 +02:00
Marton Balint
ecdf52745f avfilter/vf_framerate: always request input if no output is provided in request_frame
Fixes ticket .

Signed-off-by: Marton Balint <cus@passwd.hu>
2017-04-12 21:08:45 +02:00
Michael Niedermayer
07e7ebf52d add release notes based on release 3.2
Name suggestion was from Tobias Rapp and Bodecs Bela

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-04-12 03:12:19 +02:00
Michael Niedermayer
37589e6443 Update for 3.3
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-04-12 02:24:58 +02:00
Michael Niedermayer
ad37fb86d7 doc/APIchanges: Fill in missing fields
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 5b441d2981f35e6183b0ac29fa89e089c91cf7ba)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-04-12 02:22:51 +02:00
Michael Niedermayer
4f325589f9 avformat/oggparseogm: Check ff_alloc_extradata() for failure
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 9eff4b0d2b5013e1ede86cf1a152dce164217d52)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-04-11 23:39:21 +02:00
Michael Niedermayer
707d4c7fb5 avformat/oggparseogm: Check available data before reading global header
Fixes use of uninitialized data

Found-by: Thomas Guilbert <tguilbert@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 170d864d2c508ca8111b1d108e1e964007dab712)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-04-11 23:39:21 +02:00
Michael Niedermayer
c30d0ace65 avcodec/pixlet: Reorder rlen check
This changes nothing but is nicer looking as this checks rlen

Maybe this helps coverity remove CID1397743

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit c94d551ea7b39c4e467e146cd347c407e8eb38ee)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-04-11 23:39:21 +02:00
Michael Niedermayer
0c188bc595 avcodec/mjpegenc_huffman: Assert length in ff_mjpegenc_huffman_compute_bits()
This should help coverity see that the issues this leads to cannot occur

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 8dd0c12648d838bb982ca10f384ee1f0107dfece)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-04-11 23:39:21 +02:00
Rostislav Pehlivanov
72e038acaf mpegvideo_enc: disable optimized huffman coding with AMV or slice threads
Doesn't work yet with slice threading and won't work with AMV.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 03eb0515c12637dbd20c2e3ca8503d7b47cf583a)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-04-11 23:39:21 +02:00
Michael Niedermayer
83e6a4a32b Revert "mjpegenc: disable huffman coding with AMV"
This was the wrong patch

This reverts commit 7f9b492d544ccef36f1d5d97a76d22502623d3c8.

(cherry picked from commit 724bb805ef8a6de0d9ef27a083ef501bdef2d453)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-04-11 23:39:21 +02:00
Michael Niedermayer
7182fbc471 doc/examples/decode_video: Fix format string vulnerability
Fixes: CID1404843

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 23edd41a0d6994cb5d9983d8f035e8eef78960ad)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-04-11 23:39:21 +02:00
Steven Liu
0b4d87fad1 Revert "avutil/avstring: add av_strreplace API into avstring"
This reverts commit 99e5d81ef997cb88b1a40e6f253f37f7cbf251d9.
2017-04-11 08:05:54 +08:00
Rostislav Pehlivanov
7034009f62 mjpegenc: disable huffman coding with AMV
Isn't supported.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
(cherry picked from commit 7f9b492d544ccef36f1d5d97a76d22502623d3c8)
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2017-04-09 00:02:46 +01:00
Rostislav Pehlivanov
6c9574e490 mjpegenc_common: check for codec ID before using avctx->priv_data
When coding lossless jpeg the priv context will be pointing to LJpegEncContext
rather than MpegEncContext, which the function expects.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
(cherry picked from commit 2c9be3882a03823413945bd9e2d9af33e6e322d5)
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2017-04-09 00:02:12 +01:00
James Almer
37fcf089b4 avformat/matroskaenc: don't try to update flac extradata if live streaming
(cherry picked from commit a8b5f375010912abd9d41bde0992c63a548d56a6)
2017-04-08 17:44:42 -03:00
Michael Niedermayer
f4400a92f5 avformat/mov: Check creation_time for overflow
Fixes integer overflow
Fixes: 701640

Found-by: Found-by: Thomas Guilbert <tguilbert@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 39ee3ddff87a12e108fc4e0d36f756d0ca080472)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-04-08 22:31:05 +02:00
Michael Niedermayer
a430ba9925 avcodec/dvdsubdec: Fixes 2 runtime error: left shift of 170 by 24 places cannot be represented in type 'int'
Fixes: 619/clusterfuzz-testcase-5803914534322176

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 61ee2ca7758672128e30b3e87908b6845e006d71)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-04-08 22:31:05 +02:00
Michael Niedermayer
1833ec5334 avcodec/h264: Check weight values to be within the specs limits.
Fixes: integer overflows
Fixes: 911/clusterfuzz-testcase-5415105606975488

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Reviewed-by: "Ronald S. Bultje" <rsbultje@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 08117a40157464f8a9dcc2df393fa5fe299c1e98)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-04-08 22:31:05 +02:00
Thierry Foucu
c9c977be27 libavformat/mov: Fix memory leak, need to free the chapter tracks array
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit ac24a8202a6fdfb469af1fa68d537fb2f8d1ba6a)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-04-08 22:31:05 +02:00
Mark Thompson
3c9e1b89a1 Changelog: fix position of VAAPI MPEG-2/VP8 encode entry
This was merged in the wrong place.

(cherry picked from commit 3cbf717425b68ef1a731147748edd5c087af15a1)
2017-04-02 23:20:19 +01:00
James Almer
2ff93effb3 Changelog: add missing entry for VP8 QSV decoder
(cherry picked from commit 7ab9d3f341016b76927d0876a47a13137369eb40)
2017-04-02 18:40:02 -03:00
James Almer
b1377b2d28 Changelog: add 3.3 2017-04-02 18:39:47 -03:00
Diego Biurrun
e0064df4ff build: Add missing object dependency for extract_extradata bitstream filter
Cherry-picked from libav commit cfee5e1a0fa892fadd19b8848545d62f2386a6e7

Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit f8e29a371622316c68db7017ab04dd447b0114ba)
2017-04-02 16:12:33 -03:00
Michael Niedermayer
e1cc7f83df Bump minor for 3.3
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-04-02 19:49:45 +02:00
James Almer
7942907878 compat/atomics: fix atomic_fetch_xor 2017-04-02 00:57:17 -03:00
James Almer
cbd2502939 avcodec/extract_extradata_bsf: make sure all parameter set NAL units were found for h264/hevc
Signed-off-by: James Almer <jamrial@gmail.com>
2017-04-01 17:59:06 -03:00
Michael Niedermayer
23ae3cc822 avformat/oggparsedaala: Do not leave an invalid value in gpshift
Fixes: undefined behavior
Fixes: 702974

Found-by: Thomas Guilbert <tguilbert@google.com>
Reviewed-by: Rostislav Pehlivanov <atomnuker@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-04-01 22:09:23 +02:00
Michael Niedermayer
679a315424 avformat/oggparsedaala: Check duration for AV_NOPTS_VALUE
This avoids an integer overflow
the solution matches oggparsevorbis.c and 45581ed15d2ad5955e24d809820c1675da68f500

Fixes: 700242

Found-by: Thomas Guilbert <tguilbert@google.com>
Reviewed-by: Rostislav Pehlivanov <atomnuker@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-04-01 22:09:23 +02:00
James Almer
5f23d8b405 fate: add bitexact sws_flags to hevc-extradata-reload
Makes the test output consistent across all targets.

Reviewed-by: nevcairiel
Signed-off-by: James Almer <jamrial@gmail.com>
2017-04-01 13:39:49 -03:00
Hendrik Leppkes
5c612c5ff8 Merge commit 'e18ba2dfd2d19aedc8afccf011d5fd0833352423'
* commit 'e18ba2dfd2d19aedc8afccf011d5fd0833352423':
  hwcontext_dxva2: make sure the sw frame format is the right one during transfer

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2017-04-01 18:53:40 +02:00
Hendrik Leppkes
0f9ce9c5fc Merge commit '5a1d605ceae448b476a525f7368ec452000d1f26'
* commit '5a1d605ceae448b476a525f7368ec452000d1f26':
  hwcontext_dxva2: split transfer_data() into upload/download functions

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2017-04-01 18:53:36 +02:00
Hendrik Leppkes
fbfa72916c Merge commit '9d7026574bbbe67d004a1c32911da75375692967'
* commit '9d7026574bbbe67d004a1c32911da75375692967':
  hwcontext_dxva2: fix handling of the mapping flags

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2017-04-01 18:53:32 +02:00
Hendrik Leppkes
d91e7aac12 Merge commit '0d3176e32f351d18d6174d8b05796829a75a4c6b'
* commit '0d3176e32f351d18d6174d8b05796829a75a4c6b':
  hwcontext_dxva2: do not assume the destination format during mapping is always the right one

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2017-04-01 18:53:27 +02:00
Paul B Mahol
358d4524cc avcodec/dnxhdenc: fix indentation issue
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-04-01 18:51:18 +02:00
Paul B Mahol
f078bc4c5e avcodec/dnxhdenc: DNxHR 444 and HQX support
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-04-01 18:46:40 +02:00
Clément Bœsch
507a85b93c Merge commit 'adb0e941c329a4778ade6dd0a326274472992f54'
* commit 'adb0e941c329a4778ade6dd0a326274472992f54':
  avpacket: Mark src pointer as constant

See 5bb3f8825584a319b25b430e4ece2fa5b2b47ff9

Merged-by: Clément Bœsch <u@pkh.me>
2017-04-01 18:23:21 +02:00
Clément Bœsch
a3fc5f535a doc/libav-merge: document hlsenc encryption state 2017-04-01 18:21:34 +02:00