1
mirror of https://git.videolan.org/git/ffmpeg.git synced 2024-08-29 04:36:13 +02:00
Commit Graph

34273 Commits

Author SHA1 Message Date
Michael Niedermayer
0eb7de1973 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>
2015-11-15 22:11:05 +01:00
Michael Niedermayer
65d3359fb3 avcodec/jpeg2000dec: Fix potential integer overflow with tile dimensions
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-15 21:36:19 +01:00
Michael Niedermayer
6ef819c40b 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>
2015-11-15 21:36:19 +01:00
Michael Niedermayer
a1a8cbcb35 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>
2015-11-15 20:53:22 +01:00
Michael Niedermayer
016fd413f9 avcodec/jpeg2000: Use av_image_check_size() in ff_jpeg2000_init_component()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-15 20:53:22 +01:00
Michael Niedermayer
7ad698e24e 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>
2015-11-15 18:32:22 +01:00
Ganesh Ajjanagadde
064ced5dc1 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>
2015-11-15 10:26:26 -05:00
Michael Niedermayer
4a9af07a49 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>
2015-11-15 15:25:51 +01:00
Andreas Cadhalpun
6a69a175e7 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>
2015-11-15 10:26:48 +01:00
Matthieu Bouron
0cdc77f104 lavc/pngdec: set FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM capability 2015-11-15 10:13:24 +01:00
Matthieu Bouron
ad0203d7b0 lavc/mjpegdec: set FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM capability 2015-11-15 10:13:24 +01:00
Matthieu Bouron
e162542e15 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.
2015-11-15 10:13:00 +01:00
Michael Niedermayer
08b520636e 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>
2015-11-15 01:23:25 +01:00
Michael Niedermayer
76b6f4b7d9 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>
2015-11-15 00:32:19 +01:00
Michael Niedermayer
9caa9414cc 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>
2015-11-15 00:26:01 +01:00
Michael Niedermayer
a105f52855 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>
2015-11-14 22:51:30 +01:00
Andreas Cadhalpun
603ebab8d7 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>
2015-11-14 21:52:11 +01:00
Michael Niedermayer
ebf5264cd6 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>
2015-11-14 18:26:11 +01:00
Michael Niedermayer
ac6ab77741 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>
2015-11-14 18:26:11 +01:00
Ganesh Ajjanagadde
618b3ae7d4 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>
2015-11-14 10:58:39 -05:00
Ganesh Ajjanagadde
11f0acf829 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>
2015-11-14 10:58:39 -05:00
Ganesh Ajjanagadde
c5fa42c69a 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>
2015-11-14 10:58:39 -05:00
Ganesh Ajjanagadde
f1726ad1b0 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>
2015-11-14 10:58:39 -05:00
Michael Niedermayer
c8aaae8e0f 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>
2015-11-14 16:12:15 +01:00
Michael Niedermayer
17705f5d4f 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>
2015-11-14 13:34:52 +01:00
Michael Niedermayer
e04126072e 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>
2015-11-14 13:23:14 +01:00
Michael Niedermayer
ccba8aaff2 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>
2015-11-14 13:06:25 +01:00
Andreas Cadhalpun
0a8bff788b dds: disable palette flag for compressed images
Having both is not valid and can cause a NULL pointer dereference of
frame->data[1] later.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-11-14 03:40:20 +01:00
Michael Niedermayer
df91aa034b 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>
2015-11-14 02:37:12 +01:00
Michael Niedermayer
4e16ad2868 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>
2015-11-14 01:38:15 +01:00
Michael Niedermayer
44a7f17d0b 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>
2015-11-14 00:58:54 +01:00
Will Kelleher
b1a32429ef 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>
2015-11-12 13:16:25 +01:00
Vittorio Giovara
e25cac50e0 lavc: Add missing mem.h header to libxvid and screenpresso 2015-11-12 04:39:14 +01:00
Andreas Cadhalpun
7b2211bfc4 dds: add missing newline to log messages
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-11-12 04:39:14 +01:00
Andreas Cadhalpun
29b1752861 dds: validate compressed source buffer size
A too small buffer will cause segfaults somewhere below
decompress_texture_thread.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-11-12 04:39:14 +01:00
Andreas Cadhalpun
e6459c655e dds: validate source buffer size before copying
If it is too small av_image_copy_plane segfaults.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-11-12 04:39:14 +01:00
Andreas Cadhalpun
edd0c1d78a dds: add missing newline to log messages
Reviewed-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-11-11 21:49:51 +01:00
Andreas Cadhalpun
9a37d47644 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>
2015-11-11 21:49:51 +01:00
Andreas Cadhalpun
1675809d2d 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>
2015-11-11 21:49:51 +01:00
Andreas Cadhalpun
0e36a14a42 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>
2015-11-11 21:49:51 +01:00
Hendrik Leppkes
b33d58c31f Merge commit '79f5347a983342e2711ca8ba19ec3d8d151183f0'
* commit '79f5347a983342e2711ca8ba19ec3d8d151183f0':
  avcodec: fix doxy placement

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-11-11 14:41:49 +01:00
Michael Niedermayer
4819446eae avcodec/webvttdec: Fix uninitialized use of variable "again"
Fixes CID1338336
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-11 00:40:37 +01:00
Andreas Cadhalpun
f621749d11 dvdsubdec: validate offset2 similar to offset1
If it is negative, it causes segmentation faults in decode_rle.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-11-11 00:39:47 +01:00
Ni Hui
3ea60c505f avcodec/gifdec: skip the data lzw consumed
this fixes the return code of avcodec_decode_video2 for gif decoding
and the gif frame data buffer is skipped properly

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-10 23:21:27 +01:00
Ni Hui
c75640e9c9 avcodec/lzw: ff_lzw_decode_tail() now returns the consumed bytes in lzw decompress
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-10 23:21:27 +01:00
Paul B Mahol
9c66428016 avcodec/wmaprodec: XMA1 actually have packet sequence numbers
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2015-11-10 21:24:30 +01:00
Hendrik Leppkes
0c1a6f577b Merge commit 'de41b555cdea2dcacbe98ee9edc83a8c15c73c4c'
* commit 'de41b555cdea2dcacbe98ee9edc83a8c15c73c4c':
  truemotion2: Fix the buffer check

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-11-10 17:58:14 +01:00
Hendrik Leppkes
446ac80ea5 Merge commit '4a326923381f2bc0fb7d960c8f8366a5456bc4ab'
* commit '4a326923381f2bc0fb7d960c8f8366a5456bc4ab':
  mimic: Always return on failure

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-11-10 17:56:48 +01:00
Hendrik Leppkes
8600fef123 Merge commit '60f50374f1955442dc987abc4a6c61c2109620c2'
* commit '60f50374f1955442dc987abc4a6c61c2109620c2':
  rpza: Check the blocks left before processing one

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-11-10 17:50:51 +01:00
Hendrik Leppkes
2503aa6bd9 Merge commit '0b699920f3c0b2e30969b38ce59226653f9d80ec'
* commit '0b699920f3c0b2e30969b38ce59226653f9d80ec':
  lagarith: Correctly compute hash_shift

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-11-10 17:43:17 +01:00
Michael Niedermayer
6e3244fb09 avcodec/g729postfilter: Avoid function calls in FFMAX() arguments
This avoid double calling functions

Found-by: Muhammad Faiz <mfcc64@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-10 15:44:46 +01:00
wm4
dafe4cd29c mmaldec: send only a single EOS packet on flushing
Fixes apparent mmal_port_disable() freezes in ffmmal_stop_decoder() when
calling ffmmal_decode() with flush semantics a large number of times in
a row.
2015-11-10 13:47:37 +01:00
Michael Niedermayer
8a024f6a43 avcodec/aacsbr_fixed: Try to initialize sum[0..1] differently to fix build with VS2012
Found-by: Hendrik Leppkes <h.leppkes@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-10 13:34:27 +01:00
Andreas Cadhalpun
d7f29bfa69 aacdec: don't return frames without data from aac_decode_er_frame
This is similar to commit ec38a1b for aac_decode_frame_int.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-10 02:12:38 +00:00
Andreas Cadhalpun
ef7fe9851e aacps: avoid division by zero in stereo_processing
This fixes a SIGFPE crash in the aac_fixed decoder.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Reviewed-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2015-11-10 01:33:24 +00:00
Agatha Hu
ddbad15898 avcodec/nvenc: update nvenc default parameters
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2015-11-09 13:05:02 +01:00
Anton Khirnov
79f5347a98 avcodec: fix doxy placement 2015-11-09 07:52:20 +01:00
Michael Niedermayer
dcf1cf5d24 avcodec/aacsbr: Use FLOAT_0
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-08 11:05:48 +01:00
Timothy Gu
4b80b895a9 pixblockdsp: x86: Condense diff_pixels_* to a shared macro
Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Reviewed-by: James Almer <jamrial@gmail.com>
2015-11-07 14:31:34 -08:00
Michael Niedermayer
7cea3430a5 avcodec/takdec: Use memove, avoid undefined memcpy() use
Fixes: e214333cbd94c91228e624ff39329ce6/asan_generic_4a5159_6412_96cda2530e80607210ab41ccae3d456d.tak

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-07 21:30:07 +01:00
wm4
a55fbfa4c4 mmaldec: correct package buffering accounting
The assert in ffmmal_stop_decoder() could trigger sometimes. The
packets_buffered counter was indeed not correctly maintained, and
packets were not subtracted from it if they were still in the waiting
queue.

For some reason, this happened especially with VC-1.
2015-11-07 19:24:49 +01:00
wm4
b07cbf6724 mmaldec: add vc1 decoding support 2015-11-07 19:24:49 +01:00
Andreas Cadhalpun
3e8e1a660e apng: use correct size for output buffer
The buffer needs s->bpp bytes, at maximum currently 10.
Assert that s->bpp is not larger.

This fixes a stack buffer overflow.

Reviewed-by: wm4 <nfxjfg@googlemail.com>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-11-07 13:15:14 +01:00
Will Kelleher
7f7fa90f7b hevc: extract SEI caption data
Signed-off-by: Will Kelleher <wkelleher@gogoair.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-07 12:10:55 +01:00
Michael Niedermayer
43492ff3ab avcodec/jpeg2000dec: Clip all tile coordinates
Fixes out of array access
Fixes: b877a6b788a25c70e8b1d014f8628549/asan_heap-oob_1da2c3f_2324_5a1b329b0b3c4bb6b1d775660ac56717.r3d

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-07 02:17:04 +01:00
Michael Niedermayer
c719cd6cf7 avcodec/microdvddec: Check for string end in 'P' case
Fixes out of array read
Fixes: a9502b60f4cecc19475382aee255f73c/asan_heap-oob_1e87fba_2548_a8ad47f6dde36644fe9cdc444d4632d0.sub

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-07 01:01:19 +01:00
Ronald S. Bultje
20db54906f vp9_parser: allow superframes with a single frame. 2015-11-06 17:12:03 -05:00
Michael Niedermayer
daefd8ab2f avcodec/dirac_parser: Fix undefined memcpy() use
Fixes: 9d375e415486edd1a0c826f2307d89a4/asan_generic_4a5159_1577_faa333e83dacdd9e4dd322380aeed537.iss

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-06 21:59:42 +01:00
Michael Niedermayer
cc96018c79 libopenh264enc: Set AVOption data type
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-11-06 21:55:15 +01:00
Michael Niedermayer
fcc49924db vdpau: Remove a spurious CONFIG_H263_VDPAU_HWACCEL
Fixes libavcodec/vdpau.c:282:5: warning:
    "CONFIG_H263_VDPAU_HWACCEL" is not defined [-Wundef]

Removed in d35d0c723e.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-06 21:55:15 +01:00
Paul B Mahol
b456ece557 XMA1 and XMA2 stereo decoders
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2015-11-06 13:45:50 +01:00
Michael Niedermayer
973c3dba27 avcodec/mpeg12dec: Do not call show_bits() with invalid bits
Fixes assertion failure
Fixes: 63e50545709a6440d3d59f6426d58db9/signal_sigabrt_7ffff6ae7cc9_8189_3272a3010fd98ddf947c662bbde1ac13.ts

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-06 00:56:52 +01:00
Michael Niedermayer
cea9eb9520 avcodec/dnxhddec: Make mb_scan_index a fixed length array
Fixes null pointer dereference
Fixes: 5c9d1a6f74a12763fc7c9dd7834022b9/signal_sigsegv_11f78d9_1461_ecee3c5e7205457498e79b3ffaf21d0c.mxf

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-06 00:15:21 +01:00
Michael Niedermayer
d4a731b84a avcodec/faxcompr: Add missing runs check in decode_uncompressed()
Fixes out of array access
Fixes: 54e488b9da4abbceaf405d6492515697/asan_heap-oob_32769b0_160_a8755eb08ee8f9579348501945a33955.TIF

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-05 21:36:14 +01:00
Michael Niedermayer
93f30f825c avcodec/hevc_ps: Check chroma_format_idc
Fixes out of array access
Fixes: 24d05e8b84676799c735c9e27d97895e/asan_heap-oob_1b70f6a_2955_7c3652a7f370f9f3ef40642bc2c99bb2.bit

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-05 15:04:57 +01:00
Michael Niedermayer
a813cdda48 avcodec/truemotion1: Initialize mb_change_byte only when needed
Fixes out of array read
Fixes: d92114d8c2a019b8a6e50cd2a7301b54/asan_heap-oob_26bf563_60_1d3420277533de9dbf8aba3f93af346f.avi

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-05 03:16:15 +01:00
Michael Niedermayer
a8b254e436 avcodec/ffv1dec: Print an error if the quant table count is invalid
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-05 01:31:52 +01:00
Michael Niedermayer
c665532820 avcodec/ffv1dec: Free tables on init failure
Fixes memleak
Fixes: 07ec1fc3c1cbf2d3edcd7d9b52ca156c/asan_heap-oob_13624c5_491_ecd4720a03e697ba750b235690656c8f.avi

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-05 01:31:52 +01:00
Michael Niedermayer
5745cf799a avcodec/ffv1dec: Check for 0 quant tables
Fixes assertion failure
Fixes: 07ec1fc3c1cbf2d3edcd7d9b52ca156c/asan_heap-oob_13624c5_491_ecd4720a03e697ba750b235690656c8f.avi

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-05 01:31:52 +01:00
Michael Niedermayer
cc35f6f476 avcodec/mjpegdec: Reinitialize IDCT on BPP changes
Fixes misaligned access
Fixes: dc9262a469f6f315f74c087a7b3a7f35/signal_sigsegv_2e95bcd_9_9c0f9f4a9ba82aa9b3ab2b91ce4d5277.jpg

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-04 21:51:21 +01:00
Michael Niedermayer
d24888ef19 avcodec/mjpegdec: Check index in ljpeg_decode_yuv_scan() before using it
Fixes: 04715144ba237443010554be0d05343f/asan_heap-oob_1eafc76_1737_c685b48041a563461839e4e7ab97abb8.jpg
Fixes out of array access

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-04 19:33:33 +01:00
Ganesh Ajjanagadde
fd0bf457b7 avcodec/aacsbr_template: replace qsort with AV_QSORT
When sbr->reset is set in encode_frame, a bunch of qsort calls might get made.
Thus, there is the potential of calling qsort whenever the spectral
contents change.

AV_QSORT is substantially faster due to the inlining of the comparison callback.
Thus, the increase in performance should be worth the increase in binary size.

Tested with FATE.

Reviewed-by: Rostislav Pehlivanov <atomnuker@gmail.com>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-11-04 08:15:24 -05:00
Michael Niedermayer
bc55cec57e avcodec/rawenc: Cast argument for av_image_copy_to_buffer() to const
Fixes: libavcodec/rawenc.c:64:40: warning: passing argument 3 of av_image_copy_to_buffer from incompatible pointer type [enabled by default]

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-04 04:41:22 +01:00
Michael Niedermayer
432c1f35f7 avcodec/libzvbi-teletextdec: Remove unused variable ret
Fixes: libavcodec/libzvbi-teletextdec.c:232:9: warning: unused variable ret [-Wunused-variable]

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-04 04:40:00 +01:00
Michael Niedermayer
f3867b0a4a avcodec/vdpau: Remove CONFIG_H263_VDPAU_HWACCEL
Fixes: libavcodec/vdpau.c:320:5: warning: "CONFIG_H263_VDPAU_HWACCEL" is not defined [-Wundef]

It was removed in d15adeacf3

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-04 04:30:19 +01:00
Paul B Mahol
c89e075d5a avcodec: add Interplay ACM decoder
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2015-11-03 12:01:27 +01:00
Luca Barbato
50d2a3b5f3 flashsv: Initialize the block array
Otherwise flashsv2_prime could be fed random data.

Bug-Id: 908
CC: libav-stable@libav.org

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-11-02 16:29:46 +01:00
Luca Barbato
de41b555cd truemotion2: Fix the buffer check
The variable skip contains the expected size in bytes.

Bug-Id: 906
CC: libav-stable@libav.org

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-11-02 16:29:14 +01:00
Luca Barbato
4a32692338 mimic: Always return on failure
Bug-Id: 905
CC: libav-stable@libav.org

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-11-02 16:28:31 +01:00
Luca Barbato
60f50374f1 rpza: Check the blocks left before processing one
Bug-Id: 903
CC: libav-stable@libav.org
Reported-By: Mateusz "j00ru" Jurczyk and Gynvael Coldwind

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-11-02 16:26:04 +01:00
Luca Barbato
0b699920f3 lagarith: Correctly compute hash_shift
All the values are unsigned.

Bug-Id: 907
CC: libav-stable@libav.org

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-11-02 16:25:17 +01:00
Hendrik Leppkes
d15adeacf3 Merge commit 'd35d0c723e3c8fc8cde76bf677f67928f5e179a8'
* commit 'd35d0c723e3c8fc8cde76bf677f67928f5e179a8':
  vdpau: remove dysfunctional H.263 support

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-11-02 11:58:01 +01:00
Hendrik Leppkes
3ff6d40cbc Merge commit 'b4a82e740743744136e07054525560351e4892ae'
* commit 'b4a82e740743744136e07054525560351e4892ae':
  h264: Print the complete user message

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-11-02 11:54:34 +01:00
Hendrik Leppkes
ed6d451d93 Merge commit '8487987b87a252963b27b6adfd82887ea5933918'
* commit '8487987b87a252963b27b6adfd82887ea5933918':
  h264: Print user data SEI under normal debug verbosity

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-11-02 11:53:55 +01:00
Hendrik Leppkes
1fc13a6269 Merge commit '1720791e36f9cc24c05efea5bb275ab52156ce50'
* commit '1720791e36f9cc24c05efea5bb275ab52156ce50':
  png: read and write stereo3d frame side data information

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-11-02 11:50:35 +01:00
Paul B Mahol
c293ef258c avformat/ipmovie: put video decoding_map_size into packet and use it in decoder
The size of decoding map can differ from one calculated
internally, producing artifacts while decoding video.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2015-11-02 08:44:05 +01:00
Diego Biurrun
8161220eee h264_parser: Rename close() to h264_close()
At least on AIX it conflicts with the close() libc function from unistd.h.
2015-11-01 14:52:01 +01:00
Timothy Gu
ee20354b29 pixblockdsp: Use AV_COPY128U for get_pixels_16_c
Before:
  15543 decicycles in get_pixels, 4193214 runs,   1090 skips
After:
   5713 decicycles in get_pixels, 8387564 runs,   1044 skips
2015-10-31 17:25:30 -07:00
Michael Niedermayer
507b01f899 avcodec/h264_slice: Disable slice threads if there are multiple access units in a packet
Fixes null pointer dereference
Fixes Ticket4977

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-31 22:56:48 +01:00
Clément Bœsch
953d358462 avcodec/libopenh264enc: use AV_OPT_TYPE_BOOL for allow_skip_frames option 2015-10-31 17:33:22 +01:00
Agatha Hu
20abda6b62 avcodec/nvenc: fix potential profile error when encoding yuv444p
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2015-10-31 16:00:39 +01:00
Michael Niedermayer
81d3986d2d avcodec/libopenh264enc: AV_OPT_TYPE_STRING should use .str default
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-31 02:29:01 +01:00
Michael Niedermayer
9319e08380 avcodec/libopenh264enc: Fix project name
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-31 02:21:58 +01:00
Michael Niedermayer
a75bebfe9a avcodec/libopenh264enc: set .i64 for AV_OPT_TYPE_INT
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-31 02:20:53 +01:00
Ganesh Ajjanagadde
47af5db721 all: fix enum definition for large values
ISO C restricts enumerator values to the range of int. Thus (for instance) 0x80000000
unfortunately does not work, and throws a warning with -Wpedantic on
clang 3.7.

This fixes it by using alternative expressions that result in identical
values but do not have this issue.

Tested with FATE.

Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-10-30 15:06:19 -04:00
Rémi Denis-Courmont
d35d0c723e vdpau: remove dysfunctional H.263 support
The VDPAU API never explicitly supported H.263 in the first place.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-10-30 12:46:56 +01:00
Vittorio Giovara
b4a82e7407 h264: Print the complete user message
Previously the message was cut off at 256th byte.
This will allow dumping the complete x264 encode info when needed.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-10-30 12:46:56 +01:00
Vittorio Giovara
8487987b87 h264: Print user data SEI under normal debug verbosity
Drop the need of setting -debug bugs since it's not a bug, and the
message is already under a AV_LOG_DEBUG log level. Instead only print
it when there is an actual string in it.
2015-10-30 12:46:56 +01:00
Kirill Gavrilov
1720791e36 png: read and write stereo3d frame side data information
Use optional sTER chunk defining side-by-side stereo pair
within "Extensions to the PNG 1.2 Specification", version 1.3.0.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-10-30 12:46:56 +01:00
Carl Eugen Hoyos
bd1d67efe8 lavc/proresdec2: Fix slice_count for very high resolutions.
QT ignores the value written in the frame header.
Issue reported by forum user Koracas.
2015-10-30 01:32:39 +01:00
Carl Eugen Hoyos
2f1d6d45af lavc/cdg: Add transparency support. 2015-10-30 01:24:50 +01:00
Ganesh Ajjanagadde
603d627457 avcodec/zmbvenc: use log2 instead of log()/M_LN2
This is likely more precise and conveys the intent better.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-10-29 18:46:00 -04:00
Ganesh Ajjanagadde
68ba63ebd5 avcodec/nellymoserenc: use log2 instead of log()/M_LN2
This is likely more precise and conveys the intent better.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-10-29 18:46:00 -04:00
Ganesh Ajjanagadde
4870d8518a avcodec/snowenc: use log2 instead of log() / log(2...)
This is likely more precise and conveys the intent better.
The expression has also been accordingly simplified.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-10-29 18:46:00 -04:00
Paul B Mahol
af3f793f60 avcodec: add ADPCM AICA decoder
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2015-10-29 21:26:43 +01:00
Hendrik Leppkes
7968b1f853 Merge commit '8edaf625f3c38c695c33745822182e94e17d6e1b'
* commit '8edaf625f3c38c695c33745822182e94e17d6e1b':
  libopenh264enc: Count and warn about the number of skipped frames

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-10-29 14:26:17 +01:00
Hendrik Leppkes
f79bb118f5 Merge commit '9e14a992409348630ea96521411127418a92e8a3'
* commit '9e14a992409348630ea96521411127418a92e8a3':
  libopenh264enc: Add an option for controlling the frame skipping

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-10-29 14:26:07 +01:00
Hendrik Leppkes
7c99384f3c Merge commit 'f3aff31e5f66a4f1c4e34ce4944f4a402aca61ed'
* commit 'f3aff31e5f66a4f1c4e34ce4944f4a402aca61ed':
  avpicture: Deprecate the single fields

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-10-29 14:23:24 +01:00
Hendrik Leppkes
3ec049b85d Merge commit 'a9a60106370f862e191dea58e748626da6a8fe97'
* commit 'a9a60106370f862e191dea58e748626da6a8fe97':
  avpacket: Provide an alloc and a free function for the struct

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-10-29 14:18:03 +01:00
Hendrik Leppkes
87a6f532b4 Merge commit '9b56d5c11488656254e9aed8d964ef2b7c2ff5e6'
* commit '9b56d5c11488656254e9aed8d964ef2b7c2ff5e6':
  avpacket: Deprecate av_dup_packet

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-10-29 14:16:44 +01:00
Matthieu Bouron
ff0dfb5c36 lavc/mjpegdec: honor skip_frame option 2015-10-29 12:04:11 +01:00
Matthieu Bouron
cbe2dfa4e5 lavc/pngdec: honor skip_frame option 2015-10-29 12:04:06 +01:00
Ronald S. Bultje
63fca9df9c vp9_parser: don't overwrite cached timestamps with nopts. 2015-10-28 22:15:36 -04:00
Ganesh Ajjanagadde
6dc0db6634 avcodec/motion_est_template: replace qsort with AV_QSORT
This code is in a performance critical section. AV_QSORT is
substantially faster due to the inlining of the comparison callback.
Thus, the increase in performance is worth the increase in binary size.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-10-28 21:44:24 -04:00
Martin Storsjö
8edaf625f3 libopenh264enc: Count and warn about the number of skipped frames
Signed-off-by: Martin Storsjö <martin@martin.st>
2015-10-28 23:02:52 +02:00
Martin Storsjö
9e14a99240 libopenh264enc: Add an option for controlling the frame skipping
This allows enabling the frame skipping, which is required for the
encoder to properly hit the target bitrate.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-10-28 23:02:48 +02:00
Kieran Kunhya
b8deb7c34f opus: Do not call vector_fmul_scalar on zero samples
The x86 variant of this function crashes in that specific case.

CC: libav-devel@libav.org
2015-10-28 17:57:07 +01:00
Michael Niedermayer
6dcd822904 opus: Buffer the samples from the correct offset
When not all the opus stream have the same amount of decoded samples
process the least amount and store what is left from the other streams.

Bug-Id: 909
CC: libav-stable@libav.org

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-10-28 16:59:57 +01:00
Kirill Gavrilov
bea931c2eb avcodec/png: read and write stereo3d frame side data information
Use optional sTER chunk defining side-by-side stereo pair
within "Extensions to the PNG 1.2 Specification", version 1.3.0.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-28 12:59:43 +01:00
Andreas Cadhalpun
eaa6bade37 avcodec: install avdct.h as public header
The commit 932ff70 introducing this header mentions it should be public.

Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-10-27 22:51:54 +01:00
Luca Barbato
f3aff31e5f avpicture: Deprecate the single fields
Silence pointless warnings from gcc.
2015-10-27 21:53:26 +01:00
Hendrik Leppkes
c2f861ca42 Replace remaining occurances of av_free_packet with av_packet_unref 2015-10-27 14:35:30 +01:00
Hendrik Leppkes
7f5af80ba4 Merge commit 'ce70f28a1732c74a9cd7fec2d56178750bd6e457'
* commit 'ce70f28a1732c74a9cd7fec2d56178750bd6e457':
  avpacket: Replace av_free_packet with av_packet_unref

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-10-27 14:28:56 +01:00
Hendrik Leppkes
5fe1578571 Merge commit '9cbae3a7d57bd2b862c37fd8123bd1fba680e801'
* commit '9cbae3a7d57bd2b862c37fd8123bd1fba680e801':
  roqvideodec: use av_frame_copy

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-10-27 14:07:36 +01:00
Hendrik Leppkes
564eabeebb Merge commit '3c5cf2a31b4b29a8e4282cbe6a3f0617c14698b8'
* commit '3c5cf2a31b4b29a8e4282cbe6a3f0617c14698b8':
  screenpresso: Drop parameter change check

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-10-27 14:05:41 +01:00
Hendrik Leppkes
0a830b95d5 Merge commit '447b5b278c689b21bbb7b5747c8773145cbd9448'
* commit '447b5b278c689b21bbb7b5747c8773145cbd9448':
  mpegvideo_enc: Fix encoding videos with less frames than the delay of the encoder

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-10-27 14:04:47 +01:00
Hendrik Leppkes
8b3228a329 Merge commit '533a6198505edd1379e1cd722852350ae4a85acc'
* commit '533a6198505edd1379e1cd722852350ae4a85acc':
  innoHeim/Rsupport Screen Capture Codec decoder

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-10-27 13:58:44 +01:00
Hendrik Leppkes
8dde5dc05a Merge commit '233d2fa0443197df12b4f7823d591dad964149b3'
* commit '233d2fa0443197df12b4f7823d591dad964149b3':
  kvazaar: Add libkvazaar HEVC encoder

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-10-27 13:49:37 +01:00
Hendrik Leppkes
e7a57d4873 Merge commit '1ec72c6c68dbc78bf4ebb6f06c13316dc488bdfa'
* commit '1ec72c6c68dbc78bf4ebb6f06c13316dc488bdfa':
  libx264: Make sure the extradata are padded

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-10-27 12:48:27 +01:00
Hendrik Leppkes
0bcb17d44e Merge commit 'dca23ffbc7568c9af5c5fbaa86e6a0761ecae50c'
* commit 'dca23ffbc7568c9af5c5fbaa86e6a0761ecae50c':
  lavc: Deprecate AVPicture structure and related functions

Deprecation flag on AVPicture struct replaced by a comment, as it causes
excess deprecation warnings for every include of avcodec.h

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-10-27 12:40:04 +01:00
Hendrik Leppkes
31741aecbf avcodec: disallow hwaccel with frame threads
HWAccels with frame threads are fundamentally flawed in avcodecs current
design, and there are several known problems ranging from image corruption
to driver crashes.

These problems come down to two design problems in the interaction of
threads and HWAccel decoding:

(1)
While avcodec prevents parallel decoding and as such simultaneous access
to the hardware accelerator from the decoding threads, it cannot account
for the user code and its access to the hardware surfaces and the hardware
itself.

This can result in image corruption or even driver crashes if the
user code locks image surfaces while they are being used by the decoder
threads as reference frames.

The current HWAccel API does not offer any way to ensure exclusive access
to the hardware or the surfaces if frame threading is used.

(2)
Initialization of the HWAccel with frame threads is non-trivial, and many
decoders had and still have issues that cause excess calls to the
get_format callback.

This will potentially cause duplicate HWAccel initialization, which in
extreme cases can even lead to driver crashes if the HWAccel is
re-initialized while the user code is actively accessing the hardware
surfaces associated with it, or lead to image corruption due to lost
reference frames.

While both of these issues are solvable, fixing (1) would at least require
a huge API redesign which would move a lot of complexity into the user
code.

The only reason the combination of frame threads and HWAccel was
considered useful is to allow a seamless fallback to multi-threaded
software decoding if the HWAccel is not available, however the issues
outlined above far outweigh this.

The proper solution for a fallback is to re-open the AVCodecContext with
threading enabled if the HWAccel failed, which is a practice commonly used
by various user applications using avcodec today already.

Reviewed-by: Gwenole Beauchesne <gb.devel@gmail.com>
Reviewed-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-10-27 10:19:05 +01:00
Timothy Gu
9b40ce5a45 avcodec: srtdec: Reindent 2015-10-26 23:23:59 -07:00
Kieran Kunhya
b3e5f15b95 opusdec: Don't run vector_fmul_scalar on zero length arrays
Fixes crashes on fuzzed files
Fixes Ticket4969 part2

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-27 02:45:40 +01:00
Michael Niedermayer
07225fa74f avcodec/opusdec: Fix extra samples read index
Fixes crash
Fixes Ticket4969 part 1

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-27 02:37:16 +01:00
Luca Barbato
a9a6010637 avpacket: Provide an alloc and a free function for the struct
Pave the way for having the size of the AVPacket struct not part
of the ABI.
2015-10-26 18:00:55 +01:00
Luca Barbato
9b56d5c114 avpacket: Deprecate av_dup_packet
As documented, `av_dup_packet` is broken by design, `av_packet_ref`
matches the AVFrame ref-counted API and can be safely used instead.
2015-10-26 18:00:55 +01:00
Luca Barbato
ce70f28a17 avpacket: Replace av_free_packet with av_packet_unref
`av_packet_unref` matches the AVFrame ref-counted API and can be used as
a drop in replacement.

Deprecate `av_free_packet`.
2015-10-26 18:00:55 +01:00
Clément Bœsch
51ee62d50b avcodec/options: remove a few more redundant "default" information 2015-10-26 15:39:09 +01:00
Clément Bœsch
90c4ccc629 avcodec/options: remove redundant and wrong default information for skipcmp option 2015-10-26 15:39:09 +01:00
Clément Bœsch
7794627032 avcodec/avdct: remove redundant "default" information in options 2015-10-26 15:39:09 +01:00