Commit Graph

26970 Commits

Author SHA1 Message Date
Michael Niedermayer
d66bab0a69 avcodec/hevc_ps: check that VPS referenced from SPS exists
This matches how its done for SPS/PPS.
An alternative to this is to check it when its used.

Fixes null pointer dereference
Fixes: signal_sigsegv_e30a43_1437_CIP_A_Panasonic_3.bit
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-06 04:30:04 +01:00
Michael Niedermayer
4816d63fb7 avcodec/huffyuvdec: optimize decode_plane_bitstream(), use joint tables for new yuv formats
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-06 01:38:14 +01:00
Michael Niedermayer
27b1e63f32 avcodec/huffyuv: Support more 8bit YUV formats
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-06 01:02:26 +01:00
Michael Niedermayer
d18234f319 Merge commit '7840c40445c9f52aeccba96de3d27613398bfbf2'
* commit '7840c40445c9f52aeccba96de3d27613398bfbf2':
  (e)ac3dec: set AV_FRAME_DATA_MATRIXENCODING side data.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-05 23:14:26 +01:00
Michael Niedermayer
7b3c78b5e6 Merge commit '13345fc1f86fc3615789e196d5a339c1c27c9068'
* commit '13345fc1f86fc3615789e196d5a339c1c27c9068':
  (e)ac3: parse and store the Dolby Surround, Surround EX and Headphone mode flags.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-05 23:06:53 +01:00
Michael Niedermayer
85b424a45e Merge commit 'e92123093dfdca0ef6608998240e2f9345d63bff'
* commit 'e92123093dfdca0ef6608998240e2f9345d63bff':
  mlpdec: set AV_FRAME_DATA_MATRIXENCODING side data.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-05 23:00:22 +01:00
Michael Niedermayer
b4107f7805 Merge commit '4b7f1a7ced0e98f2cc698d896f7ebab8d30eaa09'
* commit '4b7f1a7ced0e98f2cc698d896f7ebab8d30eaa09':
  mlp: Parse TrueHD decoder channel modifiers and set the AVMatrixEncoding for each substream.

Conflicts:
	libavcodec/mlp_parser.h
	libavcodec/mlpdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-05 22:53:13 +01:00
Michael Niedermayer
ae01af2475 Merge commit '30d70e79a6b4ac7f4eb66446a9da275161ef6ea7'
* commit '30d70e79a6b4ac7f4eb66446a9da275161ef6ea7':
  dcadec: set AV_FRAME_DATA_MATRIXENCODING side data.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-05 22:34:21 +01:00
Michael Niedermayer
bc7f76377c Merge commit '6bfdb2de881372048be7fbda643417e1fd3ce93c'
* commit '6bfdb2de881372048be7fbda643417e1fd3ce93c':
  dcadec: set the output channel mode more accurately.

Conflicts:
	libavcodec/dcadec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-05 22:27:34 +01:00
Michael Niedermayer
4cf4da9dc5 Merge commit '5b4797a21db900b7d509660b7a4d49829089b004'
* commit '5b4797a21db900b7d509660b7a4d49829089b004':
  avframe: add AV_FRAME_DATA_MATRIXENCODING side data type.

Conflicts:
	libavutil/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-05 22:12:41 +01:00
Ronald S. Bultje
847072873c vp9_parse: don't use AVCodecParserContext as av_log context.
Fixes trac ticket 3273.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-05 21:45:24 +01:00
Tim Walker
7840c40445 (e)ac3dec: set AV_FRAME_DATA_MATRIXENCODING side data. 2014-01-05 16:41:56 +01:00
Tim Walker
13345fc1f8 (e)ac3: parse and store the Dolby Surround, Surround EX and Headphone mode flags. 2014-01-05 16:41:56 +01:00
Tim Walker
e92123093d mlpdec: set AV_FRAME_DATA_MATRIXENCODING side data. 2014-01-05 16:41:56 +01:00
Tim Walker
4b7f1a7ced mlp: Parse TrueHD decoder channel modifiers and set the AVMatrixEncoding for each substream. 2014-01-05 16:41:56 +01:00
Tim Walker
30d70e79a6 dcadec: set AV_FRAME_DATA_MATRIXENCODING side data. 2014-01-05 16:41:56 +01:00
Tim Walker
6bfdb2de88 dcadec: set the output channel mode more accurately.
When downmixing 2.1 to 2-channel, if the 2.0 portion is Lt/Rt, sum-difference or dual mono, the actual output will be the same (with the LFE either mixed-in or discarded).

Also, when downmixing an arbitrary layout to 2-channel, if the bitstream contains custom downmix coefficients targeting Lt/Rt, then the output will be Lt/Rt rather than regular Stereo.
2014-01-05 16:41:56 +01:00
Tim Walker
5b4797a21d avframe: add AV_FRAME_DATA_MATRIXENCODING side data type.
Includes a libavcodec utility function to update a frame's side data.
2014-01-05 16:41:56 +01:00
Michael Niedermayer
fd53f9d985 Merge commit '7f29644108c5fbd80f160930b31b78b8704c1a49'
* commit '7f29644108c5fbd80f160930b31b78b8704c1a49':
  aac: Fix low delay windowing.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-05 02:18:57 +01:00
Michael Niedermayer
4195ae0fd8 Merge commit 'b2212dec0f011893ec68eecaa990170fa24050d7'
* commit 'b2212dec0f011893ec68eecaa990170fa24050d7':
  aac: Fix TNS decoding for the 512 sample window family.

also temporarily disable fate-aac-er_ad6000np_44_ep0 as this commit
causes a mismatch with the reference pcm file
The test will be reenabled after all fixes and with a new pcm reference

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-05 02:02:02 +01:00
Alex Converse
7f29644108 aac: Fix low delay windowing.
AAC LD uses a low overlap sine window instead of a KBD window.
2014-01-04 14:42:38 -08:00
Alex Converse
b2212dec0f aac: Fix TNS decoding for the 512 sample window family. 2014-01-04 14:42:38 -08:00
Michael Niedermayer
d8e65e9224 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  arm: Use the matching endfunc macro instead of the assembler directive directly

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-04 13:19:54 +01:00
Michael Niedermayer
63ce041a7d Merge commit '2ad4ee345a4216aef3999f57dd14c56128d27a13'
* commit '2ad4ee345a4216aef3999f57dd14c56128d27a13':
  arm: Add a missing endfunc macro call

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-04 13:13:39 +01:00
Martin Storsjö
3348e3492d arm: Use the matching endfunc macro instead of the assembler directive directly
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-01-04 13:53:08 +02:00
Martin Storsjö
2ad4ee345a arm: Add a missing endfunc macro call
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-01-04 13:53:02 +02:00
Michael Niedermayer
be524ffc16 avcodec/rv30: put the rpr check back in init with the max vs bits bug fixed
Its usefull to know immediatly if extradata is wrong and not just when later
the decoder tries to use it.

This check was removed by: a6a2282c25
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-04 04:33:01 +01:00
Michael Niedermayer
d08c6e1101 avcodec/rv30: check rpr before use against maximum
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-04 04:17:15 +01:00
Michael Niedermayer
a881b9aa08 avcodec/rv30: cleanup rpr handling
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-04 04:16:46 +01:00
Michael Niedermayer
958e311974 avcodec/rv10: cleanup rpr handling
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-04 04:15:22 +01:00
Michael Niedermayer
adc09a353c Merge remote-tracking branch 'qatar/master'
* qatar/master:
  mpegvideo: remove disabled bfin asm

Conflicts:
	libavcodec/bfin/mpegvideo_bfin.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-04 03:13:54 +01:00
Michael Niedermayer
9b9f64fe31 Merge commit 'a4d0c6e0503562d4cc8f9f6d02d84d7b32583b15'
* commit 'a4d0c6e0503562d4cc8f9f6d02d84d7b32583b15':
  mpegvideo: move dct_unquantize functions up to avoid forward declarations

Conflicts:
	libavcodec/mpegvideo.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-04 03:03:02 +01:00
Michael Niedermayer
fb17f03dad Merge commit 'aec25b1c4650944d32706bfd40eb02bbd5587303'
* commit 'aec25b1c4650944d32706bfd40eb02bbd5587303':
  mpegvideo: split the encoding-only parts of frame_start() into a separate function

Conflicts:
	libavcodec/mpegvideo.c
	libavcodec/mpegvideo_enc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-04 02:56:29 +01:00
Michael Niedermayer
8e6af036b9 Merge commit '58312b2472d3a44d7458865c459d59ef2e02bf1a'
* commit '58312b2472d3a44d7458865c459d59ef2e02bf1a':
  h264: reset data_partitioning if decoding the slice header for NAL_DPA fails

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-04 02:06:21 +01:00
Michael Niedermayer
508229adb9 Merge commit 'e89aa4bf56e5b5c45f569eb12733519789e057da'
* commit 'e89aa4bf56e5b5c45f569eb12733519789e057da':
  lzw: switch to bytestream2

Conflicts:
	libavcodec/lzw.c

See: 44c4170c52
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-04 02:00:07 +01:00
Michael Niedermayer
405b1ef898 Merge commit '24057c83207d6ea8bfd824155ac37be8a33dfd0c'
* commit '24057c83207d6ea8bfd824155ac37be8a33dfd0c':
  eacmv: check the framerate before setting it.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-04 01:07:05 +01:00
Michael Niedermayer
c13e73c25b Merge commit '5569146d48f06564e8fa393424782cceed510916'
* commit '5569146d48f06564e8fa393424782cceed510916':
  adx: check that the offset is not negative

See: 30bce34b67
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-04 01:00:19 +01:00
Michael Niedermayer
3cf1503beb Merge commit 'a6a2282c25abe43e352010a7c3fbc92994c0bc1c'
* commit 'a6a2282c25abe43e352010a7c3fbc92994c0bc1c':
  rv30: fix extradata size check.

Conflicts:
	libavcodec/rv30.c

See: 09c5f990bc
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-04 00:39:51 +01:00
Michael Niedermayer
532b93b516 Merge commit 'feded990e3ef9af4a0b827d5b6d8fe86f0b94942'
* commit 'feded990e3ef9af4a0b827d5b6d8fe86f0b94942':
  mpegvideo: set reference/pict_type on generated reference frames

Conflicts:
	libavcodec/mpegvideo.c

The picture type is left at P type as it was explicitly set before

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-04 00:16:58 +01:00
Michael Niedermayer
950fb8acb4 avcodec/mpegvideo: fix ac/dc_val and coded_block table sizes
With interlaced vc1 it was possible that accesses could happen outside these
tables before this.

Regression since 017e234c20
Reproduced with a sample from Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Fixes (again) : 480i30__codec_WVC1__mode_2__framerate_29.970__type_2__preproc_17.SIGFPE.bfa.390.wmv
No releases are affected by this

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-03 20:35:55 +01:00
Anton Khirnov
a3a55645f0 mpegvideo: remove disabled bfin asm
It has been disabled as 'broken' over 3 years ago in b716a792
2014-01-03 16:54:24 +01:00
Anton Khirnov
a4d0c6e050 mpegvideo: move dct_unquantize functions up to avoid forward declarations 2014-01-03 16:54:00 +01:00
Anton Khirnov
aec25b1c46 mpegvideo: split the encoding-only parts of frame_start() into a separate function
This introduces some code duplication. However, much of it should go
away once the decoders stop using MpegEncContext.
2014-01-03 16:52:49 +01:00
Anton Khirnov
58312b2472 h264: reset data_partitioning if decoding the slice header for NAL_DPA fails
If it was set before then we can end up trying to decode a slice without
a valid slice header, which can lead to invalid memory access.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-01-03 16:42:02 +01:00
Anton Khirnov
e89aa4bf56 lzw: switch to bytestream2
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-01-03 16:40:43 +01:00
Anton Khirnov
24057c8320 eacmv: check the framerate before setting it.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-01-03 16:39:09 +01:00
Anton Khirnov
5569146d48 adx: check that the offset is not negative
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-01-03 16:38:36 +01:00
Anton Khirnov
a6a2282c25 rv30: fix extradata size check.
It has been checking the number of bits in the offset instead of the
actual offset.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-01-03 16:38:33 +01:00
Anton Khirnov
feded990e3 mpegvideo: set reference/pict_type on generated reference frames
Otherwise the generic code will unref them, which can then result in
last_picture_ptr == current_picture_ptr, which causes deadlocks at least
in rv40.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-01-03 16:36:43 +01:00
Michael Niedermayer
0389f9abe9 avcodec/avcodec: document that some video decoders do not support linesizes changing between frames.
Omission in the documentation found by: Sebastian Dröge
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-03 15:35:11 +01:00
Dale Curtis
4feca2214a h264: Clear ERContext.cur_pic when unref'ing current picture.
Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
2014-01-02 23:49:06 +01:00
Michael Niedermayer
2e59ffbb79 avcodec/mace: check buffer size
Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7f9d2775e090_8782_surge-2-8-MAC3.mov
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-02 22:07:09 +01:00
Michael Niedermayer
c925e960e8 mp3on4: fail when the header check fails
It seems the code assumed that when one out of multiple blocks fail
some span of time is correct, its not, its some channels
that are correct

Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7f44a03ba3ce_5692_id5_1.mp4
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-02 18:53:41 +01:00
Michael Niedermayer
6433b393ba avcodec/aacps: fix number of bands used with ipd/opd
Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7f861d16355f_1664_File1_fixed.aac
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-02 17:48:01 +01:00
Michael Niedermayer
4843227b2c avcodec/iff: ensure that runs with insufficient input dont leave uninitialized bytes in the output
Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7fa0dea15eae_8988_test.iff
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-02 14:52:02 +01:00
Maxim Poliakovski
4663a550f5 atrac3plus: Add forgotten initialization of an internal struct
This patch also fixes trac ticket 3254.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-02 02:25:37 +01:00
Michael Niedermayer
e6364ea26d avcodec/vqavideo: use av_mallocz() for decode_buffer()
Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7f62eaba897d_595_4D6EFA92.VQA
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-01 15:35:34 +01:00
Michael Niedermayer
07728a1115 avcodec/binkaudio: clear padding area of packet_buffer
Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7f0dba198b34_2970_Snd0a3a2ad4.dee
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-01 03:31:09 +01:00
Hendrik Leppkes
3d8eeea620 dxva2_vc1: signal skipped p frames
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-01 02:57:56 +01:00
Hendrik Leppkes
c5562890c7 dxva2_vc1: fix signaling of intensity compensation values
lumscale/lumshift don't get reset back to their default values if
intensity compensation is not active, and a wrong signaling here can
cause playback issues.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-01 02:57:51 +01:00
Hendrik Leppkes
719f1ce5fb vc1: set chromaformat = 1 for simple/main profile
1 is the only valid value for VC-1/WMV3, and setting it here makes sure
no invalid value is send to a hw accelerator, for example.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-01 02:57:44 +01:00
Hendrik Leppkes
e1facd3f81 dxva2_vc1: set PQUANT as described by the 2010 spec update
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-01 02:57:33 +01:00
Hendrik Leppkes
3021d1be9e dxva2_vc1: set bfraction in slice info according to spec
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-01 02:57:23 +01:00
Hendrik Leppkes
8abdf46b38 dxva2_vc1: set refdist value according to spec
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-01 02:57:16 +01:00
Michael Niedermayer
46b06bd894 avcodec/mpegvideo_enc: implement frame skip score normalization
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-01 02:46:39 +01:00
Michael Niedermayer
21a2fb7e05 avcodec/hevc: clear HEVClc when its deallocated in hevc_decode_free()
Fixes reading freed memory
Fixes: asan_heap-uaf_1abf8ef_3987_NUT_A_ericsson_4.bit
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-31 15:19:59 +01:00
Reimar Döffinger
cbeaf67888 Avoid using empty macro arguments.
These are not supported by all compilers (gcc 2.95 but also older SPARC
compilers, see gcc bug #33304 for example), and there is no real need for them.
One use of this feature remains in libavdevice/v4l2.c which can't be
replaced quite as easily.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2013-12-31 12:19:59 +01:00
Anssi Hannula
4a4437c0fb avformat/mpegts: demux timed ID3 metadata
Used in some HLS streams ("Timed Metadata for HTTP Live Streaming").

This is just ID3 tags at arbitrary stream positions, but I still added
"timed" to the codec name to avoid confusion with regular non-stream ID3
tags.

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
2013-12-31 03:13:12 +02:00
Michael Niedermayer
61d43a2651 avcodec/lagarith: check and propagate return value from init_get_bits8()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-30 14:27:33 +01:00
Michael Niedermayer
afd1245433 avcodec/lagarith: use init_get_bits8()
Suggested-by: Reimar
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-30 13:49:49 +01:00
Michael Niedermayer
6f1b296771 avcodec/lagarith: reenable buggy lag_decode_zero_run_line()
This is to prevent regressions in case the old code was able to partly
decode frames (no way to say without a testcase)
Add a memset to prevent use of uninitialized memory until we have a
testcase and can test/fix it

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-30 13:47:34 +01:00
Nicolas George
2ebaadf35c lavc/mjpegenc: use proper error codes. 2013-12-30 10:58:02 +01:00
Nicolas George
19a2d101ac lavc/mjpegenc: check av_frame_alloc() failure. 2013-12-30 10:58:02 +01:00
Nicolas George
97af2faaba lavc/libopenjpegenc: check av_frame_alloc() failure. 2013-12-30 10:58:02 +01:00
Nicolas George
a91394f4de lavc/diracdec: check av_frame_alloc() failure. 2013-12-30 10:58:01 +01:00
Nicolas George
38004051b5 lavc/utils: check av_frame_alloc() failure. 2013-12-30 10:58:01 +01:00
Nicolas George
bcfcb8b852 lavc/ffwavesynth: fix dependency sizeof(AVFrame). 2013-12-30 10:58:01 +01:00
Michael Niedermayer
4aa9c91508 Merge remote-tracking branch 'cehoyos/master'
* cehoyos/master:
  Fix condition for transparency warning in xsub encoder.
  Allow hiding the banner.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-30 02:12:53 +01:00
Michael Niedermayer
e80aa47abf avcodec/lagarith: fix init_get_bits() size in lag_decode_arith_plane()
untested due to lack of sample

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-30 00:55:32 +01:00
Michael Niedermayer
3410122c68 avcodec/lagarith: fix src/src_size for esc_count < 8
untested due to lack of sample

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-30 00:55:32 +01:00
Michael Niedermayer
100a54da52 avcodec/lagarith: disable lag_decode_zero_run_line() and ask for a sample
The code seems to have never been tested
fixing it should be quite easy but needs a sample/testcase

Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7f9a862dfabf_413_2889_assassin_OL.avi
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-30 00:52:24 +01:00
Carl Eugen Hoyos
de40905f55 Fix condition for transparency warning in xsub encoder. 2013-12-29 23:18:10 +01:00
Michael Niedermayer
5c74fa6ce0 avcodec/alsdec: skip cases where the master channel equals the current channel
Fixes: msan_uninit-mem_7f6c73c97cf9_3571_als_04_2ch48k16b.mp4
Fixes use of uninitialized memory
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Reviewed-by: Thilo Borgmann <thilo.borgmann@mail.de>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-29 12:35:57 +01:00
Michael Niedermayer
74a9c92840 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  h264: namespace the decode function

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-29 11:37:42 +01:00
Michael Niedermayer
fead24141a avcodec/vda_h264_dec: avoid declaring int in for arguments
Some compilers dont support that

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-29 03:16:28 +01:00
Michael Niedermayer
3477874abd Merge branch 'master' of https://github.com/upsuper/ffmpeg-vdadec
* 'master' of https://github.com/upsuper/ffmpeg-vdadec:
  avcodec/vda_h264_dec: add format check

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-29 03:16:09 +01:00
Maxim Poliakovski
2e1fb96af3 ATRAC+ decoder
Cleanup by Diego Biurrun.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-29 01:11:16 +01:00
Michael Niedermayer
55fa898969 avcodec/jpeg2000dec: zero Jpeg2000QuantStyle structure before use in get_qcd()
Fixes: msan_uninit-mem_7f50b84aac30_6823_mjp2.mov
Fixes use of uninitialized memory
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-28 22:08:49 +01:00
Michael Niedermayer
6ea05ef278 avcodec/h264: remove unused variable
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-28 18:19:46 +01:00
Michael Niedermayer
c09bb235bf Merge remote-tracking branch 'rbultje/vp9-simd'
* rbultje/vp9-simd:
  vp9/x86: 16px MC functions (64bit only).
  vp9/x86: 16x16 sub-IDCT for top-left 8x8 subblock (eob <= 38).

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-27 13:57:38 +01:00
Michael Niedermayer
25b243759c Merge commit 'b83d1ee3b41cfe8357836e2582104db2f3364cb0'
* commit 'b83d1ee3b41cfe8357836e2582104db2f3364cb0':
  avutil: Move library version related macros to version.h

Conflicts:
	libavcodec/version.h
	libavresample/version.h
	libavutil/avutil.h
	libavutil/utils.c

See: 183117fed7
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-27 12:01:23 +01:00
Luca Barbato
4d2bb28931 h264: namespace the decode function
Make much easier debugging.
2013-12-27 07:48:13 +01:00
Ronald S. Bultje
18175baa54 vp9/x86: 16px MC functions (64bit only).
Cycle counts for large MCs (old -> new on ped1080p.webm, mx!=0&&my!=0):
16x8:    876 ->   870  (0.7%)
16x16:  1444 ->  1435  (0.7%)
16x32:  2784 ->  2748  (1.3%)
32x16:  2455 ->  2349  (4.5%)
32x32:  4641 ->  4084 (13.6%)
32x64:  9200 ->  7834 (17.4%)
64x32:  8980 ->  7197 (24.8%)
64x64: 17330 -> 13796 (25.6%)
Total decoding time goes from 9.326sec to 9.182sec.
2013-12-26 21:05:10 -05:00
Michael Niedermayer
f55bc96a54 avcodec/pcm-dvd: reset last header on errors
Fixes: msan_uninit-mem_7f4fff975a2c_4957_dvd_audio_sample.aob
Fixes use of uninitialized memory
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-27 03:00:52 +01:00
Michael Niedermayer
42b6805cc1 avcodec/huffyuvdec: clear remainder of the array on end of input in decode_422_bitstream()
Fixes: msan_uninit-mem_7f909423efcd_9923_yuv_predmed.avi
Fixes use of uninitialized memory
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-27 00:26:57 +01:00
Diego Biurrun
b83d1ee3b4 avutil: Move library version related macros to version.h
This is a more sensible place for these macros.
2013-12-26 19:05:22 +01:00
Michael Niedermayer
d164ad3298 avcodec/ivi_common: use av_mallocz() to allocate mbs array
Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7f1dffa1c016_8245_sasha.avi
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-26 14:53:39 +01:00
Xidorn Quan
344d6db978 avcodec/vda_h264_dec: add format check
Fix crash when using this decoder for unsupported format on some version
of OS X.
2013-12-27 00:06:11 +11:00
Michael Niedermayer
14bec7dcf8 avcodec/wnv1: clear padding area of rbuf
Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7faa48586020_2145_MAILTEST.AVI
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-26 13:53:15 +01:00
Ronald S. Bultje
0d9375fc90 vp9/x86: 16x16 sub-IDCT for top-left 8x8 subblock (eob <= 38).
Sub8x8 speed (w/o dc-only case) goes from ~750 cycles (inter) or ~735
cycles (intra) to ~415 cycles (inter) or ~430 cycles (intra). Average
overall 16x16 idct speed goes from ~635 cycles (inter) or ~720 cycles
(intra) to ~415 cycles (inter) or ~545 (intra) - all measurements done
using ped1080p.webm.
2013-12-26 07:40:25 -05:00
Stefano Sabatini
334e2e2363 lavu,lavc,lswr: do not hardcode AV_SAMPLE_FMT_NB value when setting sample format max value
The constant may change in libavutil but the library may be compiled
against an older version, thus rejecting a value which is otherwise
supported by the new libavutil.

INT_MAX is used here to denote the max allowed value for a sample format.

The opt-test code is changed to provide a valid reference example.
2013-12-26 11:35:27 +01:00
Michael Niedermayer
1486ed0815 avcodec/shorten: clear bitstream buffer
Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7f3ca95606fb_6393_luckynight-partial.shn
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-26 01:35:00 +01:00
Michael Niedermayer
f07ca542e3 avcodec/vmdav: return the amount of data that has been unpacked from lz_unpack() (as well as errors)
and setup the bytestream buffer size accordingly

Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7fdcc513cd45_229_12.vmd
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-25 00:44:58 +01:00
Michael Niedermayer
bb9f55163f avcodec/eatgv: use av_mallocz() for frame_buffer
Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7fbf6159587b_2571_ORIGIN.TGV
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-24 23:20:30 +01:00
Carl Eugen Hoyos
691dec6201 Allow stream-copying grayscale mov files.
This reverts 0de2157f / r12272.
Fixes ticket #3215.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-24 22:22:16 +01:00
Ronald S. Bultje
acafbb4dd2 vp9: fix crash if segmentation=1, keyframe/intraonly=1 and updatemap=0.
The reference map is never used in such cases, but we accidently copied
it anyway. This could cause crashes if this map has not yet been
allocated. Fixes trac ticket 3188.

Reviewed-by: Clément Bœsch <u@pkh.me>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-24 11:43:53 +01:00
Ronald S. Bultje
4a55bffad3 vp9: fix bug in updating of coef probabilities with parallelmode=1.
Fixes trac ticket 3228.

Reviewed-by: Clément Bœsch <u@pkh.me>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-24 11:43:08 +01:00
Jan Gerber
b2597042e5 avcodec/libopusdec: Set codec->delay to pre_skip not fixed value
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-24 04:53:52 +01:00
Michael Niedermayer
95953c1cfd avcodec/wavpack fix *void pointer arithmetic
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-23 23:12:35 +01:00
Michael Niedermayer
99978320c0 avcodec/apedec: use av_fast_padded_malloc()
Fixes use of uninitialized memory
Fixes part of msan_uninit-mem_7fa0d8c8bd58_8417_sh3.ape
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-23 18:11:35 +01:00
Michael Niedermayer
d5128fce38 avcodec/apedec: more checks for k
Fixes assertion failure
Fixes part of msan_uninit-mem_7fa0d8c8bd58_8417_sh3.ape
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-23 18:10:44 +01:00
Michael Niedermayer
d94633409b avcodec/libopencore-amr: remove av_free coded_frame.
There seems to be nothing that sets coded_frame
also av_free is wrong

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-23 17:38:39 +01:00
Michael Niedermayer
8b285f03f7 avcodec/utils: fix memleak on avcodec_open2() failure
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-23 01:54:13 +01:00
Michael Niedermayer
866c44d4b0 avcodec/wavpack: clear remainder of data in case of error in wv_unpack_mono/stereo()
Fixes use of uninitialized data
Fixes: msan_uninit-mem_7fd85b654950_4005_because.wv
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-23 00:56:18 +01:00
Ivan Kalvachev
1c63aed232 Convert XvMC to hwaccel v3
Signed-off-by: Ivan Kalvachev <ikalvachev@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-22 22:03:47 +01:00
Michael Niedermayer
102b794e09 configure: support raising major version in soname
this allows seperate installation of shared libs that should not conflict with
whatever is already installed.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-22 20:21:18 +01:00
Mason Carter
61ae993957 vc1: Fix intensity compensation performance regression
Introduced by 28243b0d35

Intensity compensation is always used once it was encountered, because
v->next_use_ic is never set back to zero.

Reset v->next_use_ic, when resetting v->next_luty/uv.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-12-22 18:31:44 +01:00
Michael Niedermayer
64b98df389 vc1: simplify *_use_ic initialization
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-22 14:59:31 +01:00
Mason Carter
ed5bed4152 VC1: Fix intensity compensation performance regression
Fix https://trac.ffmpeg.org/ticket/3204

The problem was that intensity compensation was always used once it was
encountered. This is because v->next_use_ic was never set back to zero.
To fix this, when resetting v->next_luty/uv, also reset v->next_use_ic.

This improved (restored) performance by 85% when decoding
http://bit.ly/bbbwmv

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-22 14:05:06 +01:00
Michael Niedermayer
5410a5dc66 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  hevc: move DSP declarations from hevc.h into hevcdsp.h

Conflicts:
	libavcodec/hevc.h
	libavcodec/hevcdsp.c
	libavcodec/hevcdsp.h

See: c8dd048ab8
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-22 12:46:19 +01:00
Michael Niedermayer
6fe5f770db Merge commit 'be7c323176e2e5fcf30e3d2ff20975b2f936811b'
* commit 'be7c323176e2e5fcf30e3d2ff20975b2f936811b':
  Add a libwebp encoder

Conflicts:
	Changelog
	doc/encoders.texi
	doc/general.texi
	libavcodec/version.h
	libavformat/img2enc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-22 11:53:41 +01:00
Guillaume Martres
7398e0516f hevc: move DSP declarations from hevc.h into hevcdsp.h
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-12-22 03:49:11 +01:00
Justin Ruggles
be7c323176 Add a libwebp encoder 2013-12-21 17:01:42 -05:00
Michael Niedermayer
ea1e630c47 vcodec/rv34: use av_mallocz() to allocate tables
Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7f75e2a55b88_4146_brokenaudio.rmvb
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-21 18:42:00 +01:00
Michael Niedermayer
03acb035d1 avcodec/vqavideo: clear uninitialized parts of the decode buffer
Fixes use of uninitialized memory
Fixes part of msan_uninit-mem_7f841fe2ab3b_4608_cow2_1.vqa
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-21 13:16:32 +01:00
Michael Niedermayer
263105deeb avcodec/vqavideo: check destination size on all exit pathes
Fixes part of msan_uninit-mem_7f841fe2ab3b_4608_cow2_1.vqa
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-21 13:16:00 +01:00
Michael Niedermayer
70d6ce783c Merge remote-tracking branch 'qatar/master'
* qatar/master:
  arm: Don't clobber callee saved registers in scalarproduct

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-21 01:19:59 +01:00
Michael Niedermayer
9567162237 Merge commit '78d0b7f36e39bb4745613e312024ddd508e2f0fb'
* commit '78d0b7f36e39bb4745613e312024ddd508e2f0fb':
  hevc: warn when an unknown profile is used

See: a21839149c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-21 00:54:15 +01:00
Michael Niedermayer
e00281b6f5 Merge commit '2d18aaa14bc2233b0647d2c5abb72e0bc828c2a8'
* commit '2d18aaa14bc2233b0647d2c5abb72e0bc828c2a8':
  hevc: refactor Profile Tier Level
  hevc: don't check for errors in PTL code

Conflicts:
	libavcodec/hevc_ps.c

See: 36658c978f
See: dddc9b7a8e
See: ecb21d2437
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-21 00:44:44 +01:00
Michael Niedermayer
d6b7ea06f1 Merge commit '2a41826bea3833895dc06939831b7f35ca1f597e'
* commit '2a41826bea3833895dc06939831b7f35ca1f597e':
  lavc: add HEVC profiles names

Conflicts:
	libavcodec/hevc.c
	libavcodec/version.h

See: fb7d70c1cd
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-21 00:24:43 +01:00
Michael Niedermayer
ce612fc186 Merge commit 'dfc50ac85e9d68a771b556297b7c411650206f3b'
* commit 'dfc50ac85e9d68a771b556297b7c411650206f3b':
  x86: mpegvideo: move denoise_dct asm to mpegvideoenc

Conflicts:
	libavcodec/x86/mpegvideo.c
	libavcodec/x86/mpegvideoenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-20 23:44:31 +01:00
Michael Niedermayer
4fa91b88c6 Merge commit 'b254490bdabb21bd517c05b1a68717f9952ac8c4'
* commit 'b254490bdabb21bd517c05b1a68717f9952ac8c4':
  vc1: arm: Add NEON no_rnd chroma MC

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-20 23:33:15 +01:00
Michael Niedermayer
69278d94c4 Merge commit '832e19063209a5f355af733d1a45f5051f49ce33'
* commit '832e19063209a5f355af733d1a45f5051f49ce33':
  vc1: arm: Add NEON assembly

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-20 23:12:16 +01:00
Martin Storsjö
d307e408d4 arm: Don't clobber callee saved registers in scalarproduct
q4-q7/d8-d15 are supposed to not be clobbered by the callee.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-12-20 20:48:30 +02:00
Mickaël Raulet
5c3fa74b94 hevc: support luma bit depth != chroma bit depth for PCM coding units
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-12-20 19:39:53 +01:00
Guillaume Martres
78d0b7f36e hevc: warn when an unknown profile is used
Bitstreams conforming to the spec should not use profiles not defined
in it.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-12-20 19:39:38 +01:00
Gildas Cocherel
259cddb137 hevc_ps: fix indentation
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-12-20 19:39:10 +01:00
Gildas Cocherel
2d18aaa14b hevc: refactor Profile Tier Level
Also store a few PTL flags which were skipped before

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-12-20 19:38:59 +01:00
Guillaume Martres
67bbaed5c4 hevc: don't check for errors in PTL code
According to the spec, the value of XXX_reserved_zero_44bits should be
ignored, so don't report an error when it's not zero.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-12-20 19:36:44 +01:00
Gildas Cocherel
321cb8b048 hevc: store profile and level in AVCodecContext
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-12-20 19:36:24 +01:00
Gildas Cocherel
2a41826bea lavc: add HEVC profiles names
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-12-20 19:35:27 +01:00
Michael Niedermayer
b07a5e9b6b avformat/smacker: check for format mismatch more completely
Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7f6e83322950_9769_wetlogo.smk
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-20 18:31:42 +01:00
Anton Khirnov
dfc50ac85e x86: mpegvideo: move denoise_dct asm to mpegvideoenc
This function is encoding-only.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2013-12-20 17:16:11 +01:00
Michael Niedermayer
34fe125f4b avcodec/mpegvideo_enc: fix frame skipping with intra only codecs
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-20 15:04:40 +01:00
Michael Niedermayer
241eccd628 avcodec/mpegvideo_enc: fix integer overflow with -skip_exp >= 2
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-20 14:10:34 +01:00
Mason Carter
b254490bda vc1: arm: Add NEON no_rnd chroma MC
Apply David Conrad's old patch to the modern codebase.

http://ffmpeg.org/pipermail/ffmpeg-devel/2009-April/059877.html

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-12-20 14:53:42 +02:00
Mason Carter
832e190632 vc1: arm: Add NEON assembly
For:

ff_vc1_inv_trans_{8,4}x{8,4}_{dc_,}neon
ff_put_pixels8x8_neon
ff_put_vc1_mspel_mc{0,1,2,3}{0,1,2,3}_neon (except for 00)

Based on ARM assembly code in libavcodec/arm by Rob Clark and Mans
Rullgard.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-12-20 14:53:39 +02:00
Michael Niedermayer
b3f44eafa5 avcodec/iff: warn about truncated input to decode_byterun() and clear remaining output
Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7fe205e395ed_8988_test.iff
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-19 21:22:43 +01:00
Michael Niedermayer
5a5c1b2442 avcodec/dxa: check for overread in decode_13()
Fixes use of uninitialized memory
Fixes part of msan_uninit-mem_7f5ea8284fb7_8317_scummvm.dxa
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-19 17:16:34 +01:00
Michael Niedermayer
f6c95f4f8c avcodec/dxa: add padding to decomp_buf
Fixes use of uninitialized memory
Fixes part of msan_uninit-mem_7f5ea8284fb7_8317_scummvm.dxa
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-19 17:16:01 +01:00