26074 Commits

Author SHA1 Message Date
Michael Niedermayer
9e8464e81b Merge commit '9eef9eb3014b2ed9c3ff4aac510a9f04edb555cf'
* commit '9eef9eb3014b2ed9c3ff4aac510a9f04edb555cf':
  h264: check that execute_decode_slices() is not called too many times

Conflicts:
	libavcodec/h264.c

The check is replaced by an assert() as the mb index should not ever go out
of bounds.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 64591f8f86f2dfeac13ee6b4e971d069675ca814)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-21 16:42:32 +01:00
Michael Niedermayer
30a94f1159 avcodec/mjpegdec: Dont skip picture allocation if theres no picture allocated
Fixes Ticket 3245
(cherry picked from commit ad8d063f230c05f8b5efbd05cc5a9f51a2549dcf)
2014-01-20 22:26:00 +01:00
Michael Niedermayer
9d83cff1f1 avcodec/aacdec: Dont fail if channels arent known yet
Fixes Ticket3312

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 676a395ab903cac623c5d6ddd0928c789e08a59e)
2014-01-19 14:28:18 +01:00
Michael Niedermayer
756cd1a305 avcodec/mjpegdec: Dont treat the lack of a startcode differently from end of the bitstream
Fixes Ticket3303

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 31e703e899bee74c50efd8eb62c3d012ef5ab26d)
2014-01-19 14:27:56 +01:00
Michael Niedermayer
83dc8f044d avcodec/mjpegdec: only run EOI emulation code when there was a scan
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 361e27a3d8096baacc45d2551a1ebfcbfdaa6a67)
2014-01-19 14:27:48 +01:00
Michael Niedermayer
2c5c6affb1 avcodec/mjpegdec: update cur_scan also for non-LS jpeg
This should make no difference but the variable will be used in a subsequent commit

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8893f31e206358d933abe4a5227b5ae89f5f303d)
2014-01-19 14:27:40 +01:00
Carl Eugen Hoyos
f4e051680e Fix libxvid crash on failing initialisation.
Fixes ticket #3297.
(cherry picked from commit ee3fc8aa864f6d95356a7d9d03536e2b12b891c5)
2014-01-19 14:26:15 +01:00
Clément Bœsch
d9b7557732 avcodec/libxavs: 2nd attempt to fix compilation after b18c7c8d.
(cherry picked from commit 260fc0d95b025b03b2a15116526e4c83b1ca1a31)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-14 00:29:13 +01:00
Clément Bœsch
15d7b7d7cc avcodec/libxavs: attempt to fix compilation after b18c7c8d.
(cherry picked from commit 71cd83e34cf7ba88d766434e3d2b4d99c14bf0f2)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-14 00:29:09 +01:00
Carl Eugen Hoyos
b336daa952 Fix a crash on oom when decoding hevc.
(cherry picked from commit 5ab1efb9d0dc65e748a0291b67915e35578b302e)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-13 17:20:19 +01:00
Michael Niedermayer
a0aa5c34a9 avcodec/hevc: Check entry point arrays for malloc failure
Fixes null pointer dereference
Fixes: signal_sigsegv_e1d3b6_2192_DBLK_F_VIXS_2.bit
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 22bfb4be284c12f33b9dac010713fe3ca6d974bf)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-13 16:17:08 +01:00
Luca Barbato
d63476347a hevc: Bound check slice_qp
The T-REC-H.265-2013044 page 79 states they have to be into the range
[-s->sps->qp_bd_offset, 51].

Fixes: asan_stack-oob_eae8e3_9522_WP_MAIN10_B_Toshiba_3.bit
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit aead772b5814142b0e530804486ff7970ecd9eef)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-13 16:17:04 +01:00
Luca Barbato
39545c5482 hevc: Reject impossible dependent tile
The tile 0 cannot depend on a previous one.
Prevent an out of array bound load in ff_hevc_cabac_init().

Fixes: asan_heap-oob_e3a924_1630_DBLK_A_MAIN10_VIXS_2.bit
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind

Reviewed-by: Guillaume Martres <smarter@ubuntu.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 48a5b155433ed7af20fb0a5c20ca131958727727)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-13 16:16:58 +01:00
Guillaume Martres
e43805d401 hevc: remove useless clip in FUNC(sao_band_filter)()
The src buffer should only contain values in the interval
[0, (1 << BIT_DEPTH) - 1]. Since shift = (BIT_DEPTH - 5), src[x] >> shift
must be in the interval [0, 31], so no clip is needed.

This removes the code that was changed in 5856bca360c5bc3e340a357d91b1f993c80a7bea
as the clip that was repositioned in that commit is removed

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b00a8b4d194f1bf23343f3f42138affa1fe26641)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-13 16:15:07 +01:00
Guillaume Martres
ea21b7b68c hevc: clip pixels when transquant bypass is used
Fixes: asan_stack-oob_eae8e3_7333_WPP_B_ericsson_MAIN10_2.bit
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind

This is a more proper fix than 5856bca360c5bc3e340a357d91b1f993c80a7bea

The reconstructed picture should always be clipped (see section 8.6.5),
previously we did not clip coding units where
cu_transquant_bypass_flag == 1

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c9fe0caf7a1abde7ca0b1a359f551103064867b1)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-13 16:12:17 +01:00
Luca Barbato
738a2a04b6 hevc: Clip the pixel before shifting
Prevent an out of array bound read.

Fixes: asan_stack-oob_eae8e3_7333_WPP_B_ericsson_MAIN10_2.bit
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 5856bca360c5bc3e340a357d91b1f993c80a7bea)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-13 16:12:01 +01:00
Michael Niedermayer
706dca18d0 avcodec/hevc: use av_mallocz() for allocating tab_ipm
Fixes use of uninitialized memory and out of stack array read
Fixes: signal_sigsegv_ecc526_7846_WPP_C_ericsson_MAIN_2.bit
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0999f1613bc48ed9d6578a3ad7bcd17610e07fbf)

Conflicts:

	libavcodec/hevc.c
2014-01-13 16:11:50 +01:00
Michael Niedermayer
b3c3dc54a5 avcodec/alac: only set *got_frame_ptr when all channels have been decoded
Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7f8b64436530_7895_quicktime_newcodec_applelosslessaudiocodec.m4a
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e11983bda073f8c63f60509ee753da9fba20ed10)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-13 16:10:34 +01:00
Michael Niedermayer
57824d1ba6 avcodec/wmalosslessdec: shrink output on error so no uninitialized data is returned
Fixes use of uninitialized memory
partly fixes: msan_uninit-mem_7f7834b6a530_6473_luckynight-partial.wma
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6b18a6839b43ea78e70cd3e35f781d1c955bda73)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-13 16:10:25 +01:00
Michael Niedermayer
cd753ee36b avcodec/wmalosslessdec: deallocate uninitialized frame on decode_tilehdr() failure
Fixes use of uninitialized memory
partly fixes: msan_uninit-mem_7f7834b6a530_6473_luckynight-partial.wma
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ae3856dcaf9c5ef339969c95a72bcaf7c4bba9ec)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-13 16:10:12 +01:00
Michael Niedermayer
aaaafc300d avcodec/wmalosslessdec: Pass on error code from decode_tilehdr()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 03fff09b32171e0c76d104c02ebf578c7f4fe21d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-13 16:10:09 +01:00
Michael Niedermayer
6fb0f37def avcodec/h264: fix code that blindly dereferences NULL DPB
Fixes mixed flushing and decoding NULL packets
Found-by: wm4

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d9339ab55373b12f078a3e3f1e294d8ff78652dd)

Conflicts:

	libavcodec/h264.c
2014-01-13 16:06:13 +01:00
Hendrik Leppkes
70028e917c vdpau: restore compatibility with deprecated fields in AVVDPAUContext
Fixes ticket #3133.

Signed-off-by: Hendrik Leppkes <h.leppkes@gmail.com>
Tested-by: EricV
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 23bc1351ad7db698da9348e23ee63ec7300a881d)
2014-01-11 00:21:06 +01:00
Carl Eugen Hoyos
6ce835d77f Fix libopenjpeg colour range adjust for 8<bpp<16.
Fixes ticket #3284.

Reviewed-by: Michael Bradshaw
(cherry picked from commit 8298b54179c92fc3293ea312c4fcf153917bca0a)
2014-01-10 14:07:36 +01:00
Michael Niedermayer
d45a724192 avcodec/msvideo1enc: fix SKIPS_MAX
Fixes Ticket3270

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit fb8f5d0510619cea2204246631f1c0dcd994ee25)
2014-01-09 11:43:21 +01:00
Michael Niedermayer
d1a9195863 avcodec/mjpegdec: check len in mjpeg_decode_app() more completely
Avoids len from becoming negative and causing assertion failure

Fixes: signal_sigabrt_7ffff7126425_5140_fd44dc63fa7bdd12ee34fc602231ef02.jpg

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6060234d43dcf0b5200cdd7dbd2f1542146827eb)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-08 00:25:07 +01:00
Michael Niedermayer
69aa3d5b88 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>
(cherry picked from commit 21a2fb7e0579703fdea96f659498ef8b1f243289)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-08 00:23:49 +01:00
Michael Niedermayer
413065aff4 avcodec/g2meet: check available space before copying palette
Fixes out of array read
Fixes: asan_heap-uaf_ae6067_5415_g2m4.wmv

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6d9dad6a7cb5d544d540abf941fedbd34c14d2bd)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-08 00:23:35 +01:00
Michael Niedermayer
c094aec76e avcodec/ac3dec: check bap before use.
Fixes out of array read
Fixes assertion failure
Fixes asan_static-oob_16431c0_8036_rio_bravo_mono_64_spx.ac3

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4782c4284fa3856a9b6910fe5ff6e4fb1c65b58c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-08 00:23:23 +01:00
Michael Niedermayer
5e21989de4 Revert "Merge remote-tracking branch 'qatar/master'" (43dec5ef9a360c9ffac3278f464832bd99af0cb0)
Fixes out of array accesses
Fixes asan_static-oob_eb9812_5961_iv41.avi
This reverts the merge of c9ef6b09326a24010bf86d6b0d19cfa42df4d546

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
(cherry picked from commit c3d5cd1ebfba8fe36a0da7fad47df7fdf9c4ccd0)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-08 00:23:18 +01:00
Michael Niedermayer
908b951b4e avcodec/hevc: Fix modulo operations
Fixes qp fields becoming out of range
Fixes: asan_static-oob_e393a3_6998_WPP_A_ericsson_MAIN10_2.bit
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4ced5d7780fea2ea49444d6686d26f26b3a2160f)

Conflicts:

	libavcodec/hevc_filter.c
2014-01-07 23:48:10 +01:00
Michael Niedermayer
4b0cecb457 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>
(cherry picked from commit d66bab0a69ac1860e78dd951ad8db1a507e75642)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-07 23:47:39 +01:00
Nicolas George
3dae9d13e5 lavc/mjpegenc: use proper error codes.
(cherry picked from commit 2ebaadf35c9387610ca1eb7e94c171050562a77c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-07 21:28:41 +01:00
Nicolas George
9189a0a71b lavc/mjpegenc: check av_frame_alloc() failure.
(cherry picked from commit 19a2d101acc0260bb310e79010a8491b10716189)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-07 21:28:41 +01:00
Nicolas George
4b25b5a8a3 lavc/libopenjpegenc: check av_frame_alloc() failure.
(cherry picked from commit 97af2faaba70c866ae4c11459a79a16d4a014530)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-07 21:28:41 +01:00
Nicolas George
4c3cd88144 lavc/diracdec: check av_frame_alloc() failure.
(cherry picked from commit a91394f4de63ae5c2e21c548045b79393ca7fea1)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-07 21:28:41 +01:00
Nicolas George
4d70639d53 lavc/utils: check av_frame_alloc() failure.
(cherry picked from commit 38004051b53ddecb518053e6dadafa9adc4fc1b2)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-07 21:28:41 +01:00
Nicolas George
89205b637e lavc/ffwavesynth: fix dependency sizeof(AVFrame).
(cherry picked from commit bcfcb8b8524dfcc1c37d520ccf3fba3b3a4c104d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-07 21:28:41 +01:00
Michael Niedermayer
ca22a2dec5 avcodec/utils: drop 2 dependancies on sizeof(AVFrame)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c90f31146e8b1407a4a5808d0d904d85baeed5d4)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-07 21:28:41 +01:00
Michael Niedermayer
d058583510 avcodec/libvorbisenc: drop dependancy on sizeof(AVFrame)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3c8b085764ed4b036df4a8908a0781dc6d73ee11)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-07 21:28:41 +01:00
Michael Niedermayer
4d4a10cfa1 avcodec/flashsv2enc: drop dependancy on sizeof(AVFrame)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b8f4410ff60b3a973cd13351d00a1d88eaddfb71)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-07 21:28:41 +01:00
Michael Niedermayer
ce675bd54a avcodec/j2kenc: drop dependancy on sizeof(AVFrame)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8443b27072a076abb28d7f2f60bc90e1d5c285df)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-07 21:28:41 +01:00
Michael Niedermayer
965eb42be0 avcodec/libopenjpegenc: drop dependancy on sizeof(AVFrame)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 1458f0647ca0c882cc1c29892ac130a1056a1f47)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-07 21:28:41 +01:00
Michael Niedermayer
d2578f8152 avcodec/mjpegenc: drop dependancy on sizeof(AVFrame)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 5b3f4b3ef590b1221d44d24345a846c1aa636b69)

Conflicts:

	libavcodec/mjpegenc.c
2014-01-07 21:28:41 +01:00
Michael Niedermayer
31c52cd442 avcodec/msvideo1enc: drop dependancy on sizeof(AVFrame)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c81234651f761a44a3e72829fd494211e237069c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-07 21:28:41 +01:00
Michael Niedermayer
fa220e7307 avcodec/diracdec: avoid depending on sizeof(AVFrame)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit fca7943850ecdc1e67a0275b488768be01867f75)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-07 21:28:41 +01:00
Michael Niedermayer
304260a572 avcodec/utils: implement avcodec_alloc_frame() through av_alloc_frame()
This ensures that theres just one AVFrame allocation function and libs dont
produce multiple AVFrame variants after a minor lib update

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 5abdda214df53f009434f19b9eb8e1375f2924d9)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-07 21:28:41 +01:00
Michael Niedermayer
ed621efb36 avcodec/libutvideodec: use av_frame_move_ref()
AVFrames cannot be copied literally, their definition is in
avutil and their extended_data can point to their data[]

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4c1b4ae1baf77df7150fa8cbcece8057a261e47d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-07 21:28:41 +01:00
Michael Niedermayer
9f864bd324 Merge commit 'd4f1188d1a662fed5347e70016da49e01563e8a8'
* commit 'd4f1188d1a662fed5347e70016da49e01563e8a8':
  dv: use AVFrame API properly

Conflicts:
	libavcodec/dvdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 94a849b8b6c3e4a90361485b2e12a9a5c35833a3)

Conflicts:

	libavcodec/dv.h
	libavcodec/dvdec.c
	libavcodec/dvenc.c

Author of the merged code: Anton Khirnov
2014-01-07 21:28:41 +01:00
Michael Niedermayer
117728cf8f Merge commit 'd351ef47d0e0ccb7de96b37f137c16b2885580ac'
* commit 'd351ef47d0e0ccb7de96b37f137c16b2885580ac':
  pthread_frame: use the AVFrame API properly.

Conflicts:
	libavcodec/pthread_frame.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 45fd4ec9ef2b3a7074c49cdddac6e7dcc127a874)

Conflicts:

	libavcodec/pthread_frame.c
Author of the merged code: Anton Khirnov
2014-01-07 21:28:41 +01:00