68352 Commits

Author SHA1 Message Date
Andreas Cadhalpun
9783f9fb98 avcodec/a64multienc: fix use of uninitialized values in to_meta_with_crop
Averaging over 2 pixels doesn't work correctly for the last pixel, because the
rest of the buffer is not initialized.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Andreas Cadhalpun
2ed0a77b7b avcodec/a64multienc: initialize mc_meta_charset to zero
This fixes the use of uninitialized values in avpriv_do_elbg.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Michael Niedermayer
804e1e1610 avcodec/a64multienc: don't set incorrect packet size
This fixes invalid reads of the packet buffer in av_dup_packet

Based on patch by Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Andreas Cadhalpun
99d2d1404c avcodec/a64multienc: use av_frame_ref instead of copying the frame
This fixes freeing the frame buffer twice on cleanup leading to a crash.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Michael Niedermayer
cb1c9294f3 avcodec/x86/mlpdsp_init: Simplify mlp_filter_channel_x86()
Based on patch by Francisco Blas Izquierdo Riera
Commit message partly taken from carl

fixes a compilation
error in mlpdsp_init.c with -fstack-check and some gcc compilers (I
reproduced the issue with gcc 4.7.3) by simplifying the code.

See also https://bugs.gentoo.org/show_bug.cgi?id=471756

$ make libavcodec/x86/mlpdsp_init.o
libavcodec/x86/mlpdsp_init.c: In function ‘mlp_filter_channel_x86’:
libavcodec/x86/mlpdsp_init.c:142:5: error: can’t find a register in
class ‘GENERAL_REGS’ while reloading ‘asm’
libavcodec/x86/mlpdsp_init.c:142:5: error: ‘asm’ operand has impossible
constraints

4551 -> 4509 dezicycles

Reviewed-by: Ramiro Polla <ramiro.polla@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 03f39fbb2a558153a3c464edec1378d637a755fe)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Anton Khirnov
84341627d7 h264: initialize H264Context.avctx in init_thread_copy
This prevents using a wrong (first thread's) AVCodecContext if decoding
a frame in the first pass over all threads fails.
(cherry picked from commit a06b0b1295c51d100101e0ca0434e199ad6de6b5)

Conflicts:

	libavcodec/h264.c

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Michael Niedermayer
4f694182e0 avformat/omadec: Use 64bit for ret to avoid overflow
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0f55bc29d41585d110b126cb4ed4b395fd46d7ac)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Michael Niedermayer
a2cfb784fb avformat/vqf: Use 64bit for ret to avoid overflow
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit cb08687180683a755d0fe9d425280d0e4d1e6db2)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Michael Niedermayer
6faf18acbd avformat/wtvdec: Use 64bit for ret to avoid overflow
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d44e0d8b930732a4a247b4884d75cf62b4ad3664)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Michael Niedermayer
96807933d8 avformat/mvdec: Use 64bit for ret to avoid overflow
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 26c0cc154e06cb0064b3a3da49447ac44d82444f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Michael Niedermayer
4ef32aa2a6 avformat/apngdec: Use 64bit for ret to avoid overflow
Missed this hunk in first commit

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:50 +01:00
Michael Niedermayer
727730e279 avformat/gxf: Use 64bit for res to avoid overflow
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 12987f89007ee82b9d3a6090085dfaef8461ab8b)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:50 +01:00
Michael Niedermayer
5a829ee69e avformat/idcin: Use 64bit for ret to avoid overflow
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d1923d15a3544cbb94563a59e7169291db76b312)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:50 +01:00
Michael Niedermayer
7fe22c3fe6 avformat/apngdec: Use 64bit ret to avoid overflow
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0e3d6e17dea758fdb7d0adfc57f7655551ab32b3)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:50 +01:00
Michael Niedermayer
c7565b143c avformat/asfdec: Use 64bit ret to avoid overflow
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d4936d28a11fac6c9c4b4df9625185f93b086986)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:50 +01:00
Rodger Combs
303ecfc373 wtvdec: fix integer overflow resulting in errors with large files
This fixes a regression in 9fbc613f0df1628e7e78bca791fa8833846f8210

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:50 +01:00
Carl Eugen Hoyos
1456ed2dd5 lavf: Do not list mov-only codecs in riff.c.
Instead check for all mov code-points when demuxing avi
and print a warning if a video codec is found like this.
Fixes ticket #4307.
(cherry picked from commit 2e0b5f5c90a4bc1440703ba5e8bf7139ff42f367)

Conflicts:
	libavformat/riff.c
2015-03-13 09:15:18 +01:00
Michael Niedermayer
79c9d9b134 Revert "avutil/opencl: is_compiled flag not being cleared in av_opencl_uninit"
Fixed build with opencl enabled
Found-by:  WJ Liu

This reverts commit 0f2359b86926ed33da4bd64ca76d84d03d5ad380.

(cherry picked from commit ebd59d271c24601e08c3569681b129cd27bf4070)
2015-03-09 14:32:13 -03:00
Srikanth G
d0aa3d13fa avutil/opencl: is_compiled flag not being cleared in av_opencl_uninit
When OpenCL kernels are compiled, is_compiled flag is being set for each
kernel. But, in opencl uninit, this flag is not being cleared.
This causes an error when an OpenCL kernel is tried on different OpenCL
devices on same platform.

Here is the patch with a fix

Reviewed-by; Wei Gao <highgod0401@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

(cherry picked from commit 0f2359b86926ed33da4bd64ca76d84d03d5ad380)
2015-03-06 15:51:20 -03:00
Clément Bœsch
e5cc73e0a5 avcodec/gif: fix off by one in column offsetting finding
(cherry picked from commit f9240ec01abb097263fe578d2b6fb076bb7b9263)
2015-02-16 17:59:48 +01:00
Clément Bœsch
3429714f3d avfilter/dctdnoiz: fix slice_h computation
ceilf() can only work if the reminder of the division is not 0.

This fixes memory errors with for instance:
  ffmpeg -f lavfi -i testsrc=s=800x500 -threads 3 -vf dctdnoiz -frames:v 1 -f null -

(cherry picked from commit eb7efaa9244720c5f2051d76d76faeec864eca7a)
n2.5.4
2015-02-12 20:21:56 +01:00
James Almer
ee902d3d2d x86/lossless_audiodsp: fix compilation with --disable-yasm
Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 383fddeec65f4cebcb197eae702dfefdc6192eb0)

Found-by: jamrial
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 20:04:09 +01:00
James Almer
9bc62da980 avutil/opencl: don't include config.h
It's not an installed header.

Tested-by: Thilo Borgmann <thilo.borgmann@mail.de>
Tested-by: Wei Gao <highgod0401@gmail.com>
Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 3aaff803489af21011b8cf03847e17b29643c922)
2015-02-12 15:43:47 -03:00
James Almer
2a6d16ba5f x86/swr: add missing alignment check to pack_6ch functions
Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 5f14f9e9849579b3418aebfde8a162d9c172d0ea)
2015-02-12 15:43:43 -03:00
Michael Niedermayer
c7e967a7cb Update for 2.5.4
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:44:24 +01:00
Michael Niedermayer
5262c88bb0 avformat/rtmpproto: Use av_freep() to avoid leaving stale pointers in memory
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:11:55 +01:00
Michael Niedermayer
bd78b9416d avformat/riffdec: Use av_freep() to avoid leaving stale pointers in memory
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:11:54 +01:00
Michael Niedermayer
48ae72e501 avformat/os_support: Use av_freep() to avoid leaving stale pointers in memory
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:11:54 +01:00
Michael Niedermayer
0f671dfeac avcodec/arm/videodsp_armv5te: Fix linking failure with "g++ -shared -D__STDC_CONSTANT_MACROS -o test.so ... libavcodec.a"
Tested-by: Andreas Haupt
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit cab6302534962331753fb69c674df86a458b098d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:36 +01:00
Michael Niedermayer
345962121d avcodec/mjpegdec: Skip blocks which are outside the visible area
Fixes out of array accesses
Fixes: ffmpeg_mjpeg_crash.avi

Found-by: Thomas Lindroth <thomas.lindroth@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 08509c8f86626815a3e9e68d600d1aacbb8df4bf)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:36 +01:00
Michael Niedermayer
0cbf53bdf5 avcodec/h264_slice: assert that reinit does not occur after the first slice
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 2fd9ce92af43e6dcbc8ed7c26c00b052de48ccad)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:36 +01:00
Michael Niedermayer
b20409c690 avcodec/h264_slice: ignore SAR changes in slices after the first
Fixes race condition and null pointer dereference
Fixes: signal_sigsegv_1472ac3_468_cov_2915641226_CABACI3_Sony_B.jsv

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:36 +01:00
Michael Niedermayer
7997ec54c9 avcodec/h264_slice: Check picture structure before setting the related fields
This might fix a hypothetical race condition

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:36 +01:00
Michael Niedermayer
e805826903 avcodec/h264_slice: Do not change frame_num after the first slice
Fixes potential race condition
Fixes: signal_sigsegv_1472ac3_468_cov_2915641226_CABACI3_Sony_B.jsv

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:36 +01:00
Michael Niedermayer
137a000377 avutil/opt: Fix type used to access AV_OPT_TYPE_SAMPLE_FMT
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 1750b45cdf7498d0a05bea29cafcb26aa576d595)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:36 +01:00
Michael Niedermayer
78c314e39e avutil/opt: Fix types used to access AV_OPT_TYPE_PIXEL_FMT
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a0640e63463e6428b80422c89e1bfc96147ecfc6)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:36 +01:00
Michael Niedermayer
756d85dc14 avcodec/h264: Be more strict on rejecting pps/sps changes
Fixes race condition
Fixes: signal_sigsegv_1472ac3_468_cov_2915641226_CABACI3_Sony_B.jsv

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:36 +01:00
Michael Niedermayer
eeab3e1b20 avcodec/h264: Be more strict on rejecting pps_id changes
Fixes race condition
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 31cc9c04ca386dce289864021982da62190982ab)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:36 +01:00
Michael Niedermayer
a75787a71a avcodec/h264_ps: More completely check the bit depths
Fixes out of array read
Fixes: asan_static-oob_30328b6_719_cov_3325483287_H264_artifacts_motion.h264

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:36 +01:00
Michael Niedermayer
09425294c9 Revert "avcodec/x86/lossless_audiodsp: Make scalarproduct_and_madd_int16 prototypes more similar"
This reverts commit 3b4ffba3af968ae702e3a44f6b5f53445efc7363.

Unbreaks the SSSE3 code on mingw32

Conflicts:

	libavcodec/x86/lossless_audiodsp.asm

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:36 +01:00
Michael Niedermayer
3572eaaf02 avcodec/x86/lossless_audiodsp: Move order&8 fallback into C code
This is simpler and more robust, and fixes mismatching XMM save restore
mismatches

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:36 +01:00
Michael Niedermayer
25da8d84a4 avcodec/x86/lossless_audiodsp: Make scalarproduct_and_madd_int16 prototypes more similar
This is needed as the mmx code is used as fallback from the ssse3 code

Suggested-by: jamrial
Tested-by: wm4
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3b4ffba3af968ae702e3a44f6b5f53445efc7363)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:36 +01:00
Michael Niedermayer
0f642909d8 avformat/thp: Check av_get_packet() for failure not only for partial output
Fixes null pointer dereference
Fixes: signal_sigsegv_db2c1f_3108_cov_163322880_pikmin2_opening1_partial.thp

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:36 +01:00
Michael Niedermayer
6252e9141b swscale/utils: Limit filter shifting so as not to read from prior the array
Fixes out of array read
Fixes: asan_heap-oob_1fb2f9b_3780_cov_3984375136_usf.mkv

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:36 +01:00
Michael Niedermayer
c65a731b6f avcodec/mpegvideo_motion: Fix gmc chroma dimensions
Fixes integer overflow and out of array read
Fixes: asan_heap-oob_1fb2f9b_3780_cov_3984375136_usf.mkv

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:36 +01:00
Michael Niedermayer
58096b70fa avcodec/mjpegdec: Check number of components for JPEG-LS
Fixes out of array accesses
Fixes: asan_heap-oob_1c1a4ea_1242_cov_2274415971_TESTcmyk.jpg

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:36 +01:00
Michael Niedermayer
0ae93844d0 avcodec/mjpegdec: Check escape sequence validity
Fixes assertion failure
Fixes: asan_heap-oob_1c1a4ea_1242_cov_2274415971_TESTcmyk.jpg

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:36 +01:00
Michael Niedermayer
657dc91b44 avformat/mpc8: Use uint64_t in *_get_v() to avoid undefined behavior
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 05e161952954acf247e0fd1fdef00559675c4d4d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:36 +01:00
wm4
352d17086f avformat/mpc8: fix broken pointer math
This could overflow and crash at least on 32 bit systems.

Reviewed-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b737a2c52857b214be246ff615c6293730033cfa)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:36 +01:00
wm4
193440f566 avformat/mpc8: fix hang with fuzzed file
This can lead to an endless loop by seeking back a few bytes after each
attempted chunk read. Assuming negative sizes are always invalid, this
is easy to fix. Other code in this demuxer treats negative sizes as
invalid as well.

Fixes ticket #4262.

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:36 +01:00