1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-08 13:22:53 +02:00
Commit Graph

75115 Commits

Author SHA1 Message Date
Michael Niedermayer
2f65366c11 avformat/mov: Update handbrake_version threshold for full mp3 parsing
Fixes: Endangered\ Species\ 1x01\ Collecting\ Merl.mp4

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit d3b6a9abac)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 12:30:40 +01:00
James Almer
3e3aa25afa x86/float_dsp: zero extend offset from ff_scalarproduct_float_sse
Reviewed-by: Christophe Gisquet <christophe.gisquet@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit dc79824deb)
2016-01-08 14:02:27 -03:00
Paul B Mahol
6a1bf98b3a avfilter/vf_zoompan: do not free frame we pushed to lavfi
Signed-off-by: Paul B Mahol <onemda@gmail.com>
(cherry picked from commit 8bcd1997ea)

Fixes ticket #5113.
2016-01-02 21:21:43 +01:00
Andreas Cadhalpun
79f407b79a nuv: sanitize negative fps rate
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit f6830cf5ba)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-12-20 13:39:45 +01:00
Andreas Cadhalpun
174ec7d744 nutdec: reject negative value_len in read_sm_data
If it is negative, it can cause the byte position to move backwards in
avio_skip, which in turn makes sm_size negative and thus size larger
than the size of the packet buffer, causing invalid writes in avio_read.

Also fix potential overflow of avio_tell(bc) + value_len.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit ce10f572c1)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-12-20 13:39:41 +01:00
Andreas Cadhalpun
778c8de40f xwddec: prevent overflow of lsize * avctx->height
This is used to check if the input buffer is large enough, so if this
overflows it can cause a false negative leading to a segmentation fault
in bytestream2_get_bufferu.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 9d38f06d05)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-12-20 13:39:37 +01:00
Andreas Cadhalpun
38f8c80901 nutdec: only copy the header if it exists
Fixes ubsan runtime error: null pointer passed as argument 2, which is
declared to never be null

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 9f82506c79)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-12-20 13:39:33 +01:00
Andreas Cadhalpun
945ae04fab exr: fix out of bounds read in get_code
This macro unconditionally used out[-1], which causes an out of bounds
read, if out is the very beginning of the buffer.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 90b99a8107)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-12-20 13:39:29 +01:00
Andreas Cadhalpun
6d7b4dbcb4 on2avc: limit number of bits to 30 in get_egolomb
More don't fit into the integer output.

Also use get_bits_long, since get_bits only supports reading up to 25
bits, while get_bits_long supports the full integer range.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 4d5c3b02e9)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-12-20 13:39:24 +01:00
Michael Niedermayer
644179e0d4 Update Changelog
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-20 02:58:41 +01:00
Andreas Cadhalpun
9be3441c31 rawdec: only exempt BIT0 with need_copy from buffer sanity check
Otherwise the too samll buffer is directly used in the frame, causing
segmentation faults, when trying to use the frame.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-20 02:58:21 +01:00
Andreas Cadhalpun
63ecbb82fc mlvdec: check that index_entries exist
This fixes NULL pointer dereferencing.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-20 02:42:13 +01:00
Michael Niedermayer
bdc6ba4604 avcodec/mpeg4videodec: also for empty partitioned slices
Fixes assertion failure
Fixes: id_acf3e47f864e1ee4c7b86c0653e0ff31e5bde56e.m4v

Found-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 70f13abb4f)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-19 23:54:47 +01:00
Michael Niedermayer
3a3be02208 avcodec/h264_refs: Fix long_idx check
Fixes out of array read
Fixes mozilla bug 1233606

Found-by: Tyson Smith
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit b92b4775a0)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-19 22:19:21 +01:00
Michael Niedermayer
cabd9ae5be avcodec/h264_mc_template: prefetch list1 only if it is used in the MB
Fixes ubsan warning
Fixes Mozilla bug 1230276

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit c8ea57664f)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-18 00:55:27 +01:00
Michael Niedermayer
cfbf608c0a avcodec/h264_slice: Simplify ref2frm indexing
This also suppresses a ubsan warning
Fixes Mozilla bug 1230247

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit ef8f6464a5)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-18 00:55:15 +01:00
Michael Niedermayer
1dddd5371a Revert "avcodec/aarch64/neon.S: Update neon.s for transpose_4x4H"
The change was not correct and broke H264

This reverts commit cd83f899c9.
(cherry picked from commit 95b59bfb9d)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-17 21:50:57 +01:00
Michael Niedermayer
e4a6a8553e avfilter/vf_mpdecimate: Add missing emms_c()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 997de2e810)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-17 21:32:17 +01:00
Andreas Cadhalpun
748d5fa2ed sonic: make sure num_taps * channels is not larger than frame_size
If that is the case, the loop setting predictor_state in
sonic_decode_frame causes out of bounds reads of int_samples, which has
only frame_size number of elements.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 9637c2531f)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-12-17 20:04:35 +01:00
Andreas Cadhalpun
796f1a24f5 opus_silk: fix typo causing overflow in silk_stabilize_lsf
Due to this typo max_center can be too large, causing nlsf to be set to
too large values, which in turn can cause nlsf[i - 1] + min_delta[i] to
overflow to a negative value, which is not allowed for nlsf and can
cause an out of bounds read in silk_lsf2lpc.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit f61d44b74a)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-12-17 20:04:30 +01:00
Andreas Cadhalpun
0b24a0e0f1 ffm: reject invalid codec_id and codec_type
A negative codec_id cannot be handled by the found_decoder API of
AVStream->info: if the codec_id is not recognized, found_decoder is set
to -codec_id, which has to be '<0' according to the API documentation.

This can cause NULL pointer dereferencing in try_decode_frame.

Also make sure the codec_type matches the expected one for codec_id.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit ecf63b7cc2)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-12-17 20:04:25 +01:00
Andreas Cadhalpun
a79a5c32f9 golomb: always check for invalid UE golomb codes in get_ue_golomb
Also correct the check to reject log < 7, because UPDATE_CACHE only
guarantees 25 meaningful bits.

This fixes undefined behavior:
runtime error: shift exponent is negative

Testing with START/STOP timers in get_ue_golomb, one for the first
branch (A) and one for the second (B), shows that there is practically no
slowdown, e.g. for the cavs decoder:

With the check in the B branch:
    629 decicycles in get_ue_golomb B, 4194260 runs,     44 skips
    433 decicycles in get_ue_golomb A,268434102 runs,   1354 skips

Without the check:
    624 decicycles in get_ue_golomb B, 4194273 runs,     31 skips
    433 decicycles in get_ue_golomb A,268434203 runs,   1253 skips

Since the B branch is executed far less often than the A branch, this
change is negligible, even more so for the h264 decoder, where the ratio
B/A is a lot smaller.

Fixes: mozilla bug 1230239
Fixes: fbeb8b2c7c996e9b91c6b1af319d7ebc/asan_heap-oob_195450f_2743_e8856ece4579ea486670be2b236099a0.bit

Found-by: Tyson Smith
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 22e960ad47)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-12-17 20:03:56 +01:00
Andreas Cadhalpun
b9087aa651 sbr_qmf_analysis: sanitize input for 32-bit imdct
If the input contains too many too large values, the imdct can overflow.
Even if it didn't, the output would be larger than the valid range of 29
bits.

Note that this is a very delicate limit: Allowing values up to 1<<25
does not prevent input larger than 1<<29 from arriving at
sbr_sum_square, while limiting values to 1<<23 breaks the
fate-aac-fixed-al_sbr_hq_cm_48_5.1 test.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit fdc94db37e)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-12-17 20:03:48 +01:00
Andreas Cadhalpun
7e94ea3dd1 sbrdsp_fixed: assert that input values are in the valid range
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit a9c20e922c)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-12-17 20:03:44 +01:00
Andreas Cadhalpun
cb44683a8c aacsbr: ensure strictly monotone time borders
This fixes a division by zero in the aac_fixed decoder.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit ff8816f717)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-12-17 20:03:34 +01:00
Andreas Cadhalpun
dcd837e41c aacenc: update max_sfb when num_swb changes
This fixes out-of-bounds reads in avoid_clipping.

Reviewed-by: Rostislav Pehlivanov <atomnuker@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 5b0da6999f)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-12-17 20:03:29 +01:00
Andreas Cadhalpun
507e0314c0 aaccoder: prevent crash of anmr coder
If minq is negative, the range of sf_idx can be larger than
SCALE_MAX_DIFF allows, causing assertion failures later in
encode_scale_factors.

Reviewed-by: Claudio Freire <klaussfreire@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 7a4652dd5d)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-12-17 20:03:02 +01:00
Andreas Cadhalpun
76af12f542 ffmdec: reject zero-sized chunks
If size is zero, avio_get_str fails, leaving the buffer uninitialized.
This causes invalid reads in av_set_options_string.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit a611375db5)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-12-17 20:02:55 +01:00
Michael Niedermayer
20a48eaaf1 swscale/x86/rgb2rgb_template: Fallback to mmx in interleaveBytes() if the alignment is insufficient for SSE*
This also as a sideeffect fixes the non aligned case

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit a066ff89bc)
2015-12-15 11:16:22 +01:00
Michael Niedermayer
31aeb96533 swscale/x86/rgb2rgb_template: Do not crash on misaligend stride
Fixes Ticket5013

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 80bfce35cc)
2015-12-15 11:16:10 +01:00
Michael Niedermayer
95a144ae62 avformat/mxfenc: Do not crash if there is no packet in the first stream
Fixes: Ticket4914

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit b51e7554e7)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-13 17:27:04 +01:00
Nicolas George
1450a39ad4 lavf/tee: fix side data double free.
Similar to 33fefdb44.
Fix trac ticket #4921.

Signed-off-by: Nicolas George <george@nsup.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 1acc90eaa5)

Conflicts:

	libavformat/tee.c

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-13 10:14:24 +01:00
Michael Niedermayer
d07f658201 avformat/hlsenc: Check the return code of avformat_write_header()
Fixes: segfault
Fixes: Ticket5067

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit c62d1780ff)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-13 02:59:32 +01:00
Michael Niedermayer
07b43fb69a avformat/mov: Enable parser for mp3s by old HandBrake
Fixes Ticket5047

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 861f47ddf4)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-13 02:15:36 +01:00
Michael Niedermayer
e3f08d9359 avformat/mxfenc: Fix integer overflow in length computation
Fixes: CID1341577

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 537e901fe6)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-13 02:15:14 +01:00
Michael Niedermayer
f87d2617d5 Changelog: Update
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-12 23:25:12 +01:00
zjh8890
cd83f899c9 avcodec/aarch64/neon.S: Update neon.s for transpose_4x4H
The transpose_4x4H is wrong which cost me much time to find this bug. The orders of r2 and r3 are wrong,
this bug waste me much time while I make aarch64 arm instruction which used the function.
(cherry picked from commit c18176bd55)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-12 15:05:06 +01:00
Rainer Hochecker
5e105aca01 avformat/utils: estimate_timings_from_pts - increase retry counter, fixes invalid duration for ts files with hevc codec
Fixes a mpegts file with hevc that fails estimating duration. Increasing number of
retries fixes the issue.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 2d8c2f1a28)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-09 20:46:47 +01:00
Michael Niedermayer
a9c721da12 avformat/matroskaenc: Check codecdelay before use
Fixes CID1238790

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit e6971db12b)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-09 18:27:54 +01:00
Michael Niedermayer
4608cc176b avutil/mathematics: Fix division by 0
Fixes: CID1341571

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit bc8b1e694c)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-09 17:53:44 +01:00
Andreas Cadhalpun
2e54b8c379 mjpegdec: consider chroma subsampling in size check
If the chroma components are subsampled, smaller buffers are allocated
for them. In that case the maximal block_offset for the chroma
components is not as large as for the luma component.

This fixes out of bounds writes causing segmentation faults or memory
corruption.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 5adb5d9d89)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-07 01:34:13 +01:00
Michael Niedermayer
913c642c21 Update for 2.8.4
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-06 10:42:02 +01:00
James Zern
cb4985ea9a libvpxenc: remove some unused ctrl id mappings
VP8E_UPD_ENTROPY, VP8E_UPD_REFERENCE, VP8E_USE_REFERENCE were removed
from libvpx and the remaining values were never used here

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Zern <jzern@google.com>
(cherry picked from commit 6540fe04a3)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-06 02:51:28 +01:00
Michael Niedermayer
d27d59fef7 avcodec/vp3: ensure header is parsed successfully before tables
Fixes assertion failure
Fixes: 266ee543812e934f7b4a72923a2701d4/signal_sigabrt_7ffff6ae7cc9_7322_85218d61759d461bdf7387180e8000c9.ogg

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 26379d4fdd)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-06 02:51:28 +01:00
Michael Niedermayer
ea4d9cb3e5 avcodec/jpeg2000dec: Check bpno in decode_cblk()
Fixes: undefined shift
Fixes: c409ef86f892335a0a164b5871174d5a/asan_heap-oob_1dff564_2159_162b7234616deab02b544410455eb07b.mov

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit a85b02dcf7)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-06 02:51:27 +01:00
Michael Niedermayer
e5a4044771 avcodec/pgssubdec: Fix left shift of 255 by 24 places cannot be represented in type int
Fixes: b293a6479bb4b5286cff24d356bfd955/asan_generic_225c3c9_7819_cc526b657450c6cdef1371b526499626.mkv

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 4f2419888b)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-06 02:51:27 +01:00
Michael Niedermayer
af44545613 swscale/utils: Fix for runtime error: left shift of negative value -1
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>
(cherry picked from commit 325b59368d)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-06 02:51:27 +01:00
Michael Niedermayer
10fc3d690c avcodec/hevc: Fix integer overflow of entry_point_offset
Fixes out of array read
Fixes: d41d8cd98f00b204e9800998ecf8427e/signal_sigsegv_321165b_7641_077dfcd8cbc80b1c0b470c8554cd6ffb.bit

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 2140858524)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-06 02:51:27 +01:00
Michael Niedermayer
0fa92fee43 avcodec/dirac_parser: Check that there is a previous PU before accessing it
Fixes out of array read
Fixes: 99d142c47e6ba3510a74b872a1a2ae72/asan_heap-oob_11b36f4_3811_0f5c69e7609a88a580135678de1df844.dxa

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit a08681f1e6)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-06 02:51:27 +01:00
Michael Niedermayer
cf79fd0317 avcodec/dirac_parser: Add basic validity checks for next_pu_offset and prev_pu_offset
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit c7d6ec947c)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-06 02:51:27 +01:00