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

33453 Commits

Author SHA1 Message Date
Michael Niedermayer
ff30907205 avcodec/hevc_ps: Check chroma_format_idc
Fixes out of array access
Fixes: 24d05e8b84676799c735c9e27d97895e/asan_heap-oob_1b70f6a_2955_7c3652a7f370f9f3ef40642bc2c99bb2.bit

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

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-05 15:17:56 +01:00
Michael Niedermayer
a6ae88bb25 avcodec/ffv1dec: Check for 0 quant tables
Fixes assertion failure
Fixes: 07ec1fc3c1cbf2d3edcd7d9b52ca156c/asan_heap-oob_13624c5_491_ecd4720a03e697ba750b235690656c8f.avi

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

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-05 01:49:09 +01:00
Michael Niedermayer
4567cba0b8 avcodec/mjpegdec: Reinitialize IDCT on BPP changes
Fixes misaligned access
Fixes: dc9262a469f6f315f74c087a7b3a7f35/signal_sigsegv_2e95bcd_9_9c0f9f4a9ba82aa9b3ab2b91ce4d5277.jpg

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

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-04 22:16:38 +01:00
Michael Niedermayer
fdb8842639 avcodec/mjpegdec: Check index in ljpeg_decode_yuv_scan() before using it
Fixes: 04715144ba237443010554be0d05343f/asan_heap-oob_1eafc76_1737_c685b48041a563461839e4e7ab97abb8.jpg
Fixes out of array access

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

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-04 19:42:29 +01:00
Michael Niedermayer
aa34146e41 avcodec/h264_slice: Disable slice threads if there are multiple access units in a packet
Fixes null pointer dereference
Fixes part of Ticket4977

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

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-31 22:57:52 +01:00
Kieran Kunhya
2f5f940bef opusdec: Don't run vector_fmul_scalar on zero length arrays
Fixes crashes on fuzzed files
Fixes Ticket4969 part2

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

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-30 17:55:31 +01:00
Michael Niedermayer
6ac9d6303f avcodec/opusdec: Fix extra samples read index
Fixes crash
Fixes Ticket4969 part 1

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

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-30 17:55:31 +01:00
Michael Niedermayer
81a2ad762b avcodec/ffv1: Initialize vlc_state on allocation
This ensures that they are always set to valid values
Fixes Ticket4939

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

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-30 17:55:31 +01:00
Michael Niedermayer
c8a1324d1e avcodec/ffv1dec: update progress in case of broken pointer chains
Fixes deadlock
Fixes Ticket4932

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

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-30 17:55:31 +01:00
Michael Niedermayer
6a0e10ae0d avcodec/ffv1dec: Clear slice coordinates if they are invalid or slice header decoding fails for other reasons
Fixes Ticket4931

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

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-30 17:55:31 +01:00
Ronald S. Bultje
6616762134 videodsp: don't overread edges in vfix3 emu_edge.
Fixes trac ticket 3226. Also see Andreas' analysis in
https://bugs.debian.org/801745, which was very helpful.
(cherry picked from commit 52f84d82bd)
2015-10-25 01:05:31 +02:00
周晓勇
1a67b0f9ae avcodec: loongson optimize h264dsp idct and loop filter with mmi
Change-Id: Ic87fb8f5cd22a502ff9dbbc5a5a8ea97cfc8a1dd
Signed-off-by: ZhouXiaoyong <zhouxiaoyong@loongson.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-16 14:47:56 +02:00
Michael Niedermayer
e3fcd88f08 avcodec/jpeg2000dec: Clear properties in jpeg2000_dec_cleanup() too
Fixes: Ticket4878

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

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-16 14:47:56 +02:00
Michael Niedermayer
b46efcb293 avcodec/vp8: Do not use num_coeff_partitions in thread/buffer setup
The variable is not a constant and can lead to race conditions

Fixes: repro.webm (not reproducable with FFmpeg alone)

Found-by: Dale Curtis <dalecurtis@google.com>
Tested-by: Dale Curtis <dalecurtis@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit dabea74d0e)
2015-10-14 14:15:11 +02:00
Andreas Cadhalpun
13d3749424 doc: fix spelling errors
Reviewed-by: Lou Logan <lou@lrcd.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 8d6625642d)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-10-12 21:46:54 +02:00
Michael Niedermayer
c149a4afee avcodec/pngdec: Check blend_op.
Fixes CID1322359, CID1322358

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

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-12 02:23:36 +02:00
赵宇龙
02d8abf0f5 h264_mp4toannexb: fix pps offfset fault when there are more than one sps in avcc
the pps offset is used to locate pps in the spspps_buf; however, the
current calc method is wrong because it is the offset of the original
avctx->extradata;
when there is only one sps in the avcc; the value is correct by
coincidence, however, it will
fail in avcc with multi sps

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

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-12 02:23:36 +02:00
Michael Niedermayer
9579550b2b avcodec/h264_mp4toannexb_bsf: Use av_freep() to free spspps_buf
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 3d126ef188)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-12 02:23:36 +02:00
Paul B Mahol
39df4d2475 avcodec/pngdec: reset has_trns after every decode_frame_png()
Fixes #4887.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
(cherry picked from commit 1d0487f77f)
2015-10-09 21:14:02 +02:00
wm4
291a2f1ea7 avcodec/mp3: fix skipping zeros
Commits 43bc5cf9 and c5371f77 add code for skipping initial zeros in mp3
packets. This code forgot to report to the user that data was skipped at
all.

Since audio codecs allow partial packet decoding, the user application
has to rely on the return value. It will remove the data reported as
consumed by the decoder, and feed it to the decoder again. This resulted
in the mp3 frame after the zero region to be decoded over and over
again, until the zero region was finally skipped by the application.

Fix this by including the amount of skipped bytes to the number of
consumed bytes returned by the decode call.

Fixes trac ticket #4890.
(cherry picked from commit cb1da9fb8d)
2015-10-09 21:12:30 +02:00
Shivraj Patil
a931ad554d avcodec/mips: build fix for MSA 64bit
Modified datatype of function argument (pitch from int32_t to ptrdiff_t).

Signed-off-by: Shivraj Patil <shivraj.patil@imgtec.com>
Commit in master: 322e960dbf
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-08 14:32:05 +02:00
Shivraj Patil
7236080d27 avcodec/mips: build fix for MSA
Modified sps and pps access from old HEVCContext(s) structure to newly introduced HEVCParamSets(ps).

Signed-off-by: Shivraj Patil <shivraj.patil@imgtec.com>
Commit in master: b0732b0214
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-08 14:31:49 +02:00
Michael Niedermayer
818ebcbf5c avcodec/x86/sbrdsp: Fix using uninitialized upper 32bit of noise
Fixes crash
Fixes: flicker-1.scout3d21443372922.28.m4a

Found-by: Dale Curtis <dalecurtis@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 1b82b934a1)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-08 13:15:42 +02:00
Michael Niedermayer
837113ab5f avcodec/ffv1dec: Fix off by 1 error in quant_table_count check
Fixes: invalid_read.nut
Found-by: Paul B Mahol <onemda@gmail.com>

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

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-08 13:15:42 +02:00
Michael Niedermayer
97340bdfa3 avcodec/ffv1dec: Explicitly check read_quant_table() return value
Forwards the error code, avoids potential integer overflow

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

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-08 13:15:42 +02:00
Jeremy James
61fd5a3072 dnxhddata: correct weight tables
CID 1260 (as evidenced by incorrect decoding of a sample from ticket
4876) seems to use incorrect weight tables. It appears those tables
were not zigzag-scanned.

Apply zigzag on weight tables for new CIDs 1258, 1259, and 1260, and
fix an incorrect chroma table for CID 1256.

Fixes last issue from ticket #4876.

Found-by: Christophe Gisquet <christophe.gisquet@gmail.com>
Signed-off-by: Christophe Gisquet <christophe.gisquet@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 428424fe75)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-08 13:15:42 +02:00
Christophe Gisquet
f5f9c166a1 dnxhddec: decode and use interlace mb flag
This bit is 1 in some samples, and seems to coincide with interlaced
mbs and CID1260. 2008 specs do not know about it, and maintain qscale
is 11 bits. This looks oversized, but may help larger bitdepths.

Currently, it leads to an obviously incorrect qscale value, meaning
its syntax is shifted by 1. However, reading 11 bits also leads to
obviously incorrect decoding: qscale seems to be 10 bits.

However, as most profiles still have 11bits qscale, the feature is
restricted to the CID1260 profile.

The encoder writes 12 bits of syntax, last and first bits always 0,
which is now somewhat inconsistent with the decoder, but ends up with
the same effect (progressive + reserved bit).

Partially fixes ticket #4876.

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

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-08 13:15:42 +02:00
Michael Niedermayer
3cd1be9702 avcodec/rangecoder: Check e
Fixes hang.nut

Found-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit b2955b6c5a)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-08 13:15:42 +02:00
Michael Niedermayer
d4b1fe72c2 avcodec/ffv1: seperate slice_count from max_slice_count
Fix segfault with too large slice_count
Fixes Ticket4879

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

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-08 13:15:42 +02:00
Michael Niedermayer
08fc0d771a avcodec/mjpegdec: Fix decoding RGBA RCT LJPEG
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 055e56e9f7)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-08 13:15:42 +02:00
Hendrik Leppkes
41aa6b2095 hevc: properly handle no_rasl_output_flag when removing pictures from the DPB
Fixes ticket #4185.

Reviewed-By: Mickael Raulet <Mickael.Raulet@insa-rennes.fr>
Signed-off-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-09-20 00:18:57 +02:00
Hendrik Schreiber
c3021738fc lavc: Fix compilation with --disable-everything --enable-parser=mpeg4video.
(cherry picked from commit 9d742d23d2)
2015-09-09 16:23:26 +02:00
Michael Niedermayer
b72c184194 avcodec/h264_sei: Remove "Subtitles with data type 0x%02x" sample request
Suggested-by: Carl and Hendrik
2015-09-08 23:02:00 +02:00
周晓勇
0752e44b1f avcodec: loongson delete invalid simple idct put and add optimization
Change-Id: I23a36c65915f01a1cf20e317c14b8eaaa62958b4
Signed-off-by: ZhouXiaoyong <zhouxiaoyong@loongson.cn>

Fixes Decoding of http://loongnix.org/ftp/multimedia/testing/nanocore_720p_24fps_mpeg4_ac3_short.avi

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

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-08 22:31:44 +02:00
Michael Niedermayer
1d42df7292 Add NOA credits 2015-09-08 22:31:44 +02:00
Gwenole Beauchesne
eaabfe8ef8 vaapi: fix local header include.
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
(cherry picked from commit aea611dc3e)
2015-09-07 15:32:56 +02:00
Michael Niedermayer
c41a59330f avcodec/rawenc: Use AVFrame parameters instead of AVCodecContext
This allows encoding raw frames with changing dimensions

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-05 11:56:23 +02:00
Rostislav Pehlivanov
e3faad811e aacenc_tns: adjust coefficient calculation, add double filter support
This commit improves the TNS implementation to the point where it's
actually usable and very rarely results in nastyness (in all bitrates
except extremely low bitrates it's increasing the quality and prevents
some distortions from the coder being audiable).

Also adds a double filter support which is only used if the energy
difference between the top and bottom of the SFBs is above the
thresholds defined in the header file. Looking at the bitstream
that fdk_aac generates it sometimes used a double filter despite
the specs stating that a single filter should be enough for almost
all cases and purposes.

Unlike FAAC or fdk_aac we sometimes use a reverse filter in case
the energy difference isn't enought to use a double filter. This
actually works better.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2015-09-05 09:08:30 +01:00
Rostislav Pehlivanov
7591f8319b lpc: increase error array size of ff_lpc_calc_ref_coefs_f by one
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2015-09-05 08:51:19 +01:00
Rostislav Pehlivanov
4565611b04 aacenc_is: add a flag to use pure coefficients instead
This commit adds a flag to use the pure coefficients instead
of the processed ones (sce->coeffs). This is needed because
IS will apply the changes to the coefficients immediately
before the adjust_common_prediction function and it doesn't
make sense to measure stereo channel coefficient difference
when one of the channels coefficients are all zero.

Therefore add a flag to use pure coefficients in that case.
TNS is the only thing touching the coefficients before IS
so common window prediction will not take that into account
but the effect of the TNS filter per coefficient can be small
(a few percent) so to some approximation it's fine to just
ignore that.

Also fixed a small error which doesn't alter the results
that much. pow(sqrt(number), 3.0/4.0) == pow(number, 3.0/8.0) !=
pow(number, 3.0/4.0).

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2015-09-05 08:32:09 +01:00
Michael Niedermayer
a87ada53c3 avcodec/jpeg2000dec: Initialize ret to avoid warning and make the code more robust
"Fixes" CID1322361

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-05 00:38:21 +02:00
Michael Niedermayer
9e70475551 avcodec/jpeg2000dec: Assert that step_x/y are valid
Fixes CID1322304, CID1322305

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-05 00:37:53 +02:00
Michael Niedermayer
205c31b301 avcodec/hapdec: Check section_size for non negativity in parse_section_header()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-05 00:37:53 +02:00
Carl Eugen Hoyos
f253c34175 lavc/j2kenc: Remove experimental flag.
The encoder produces valid and - if requested - lossless files.
2015-09-04 23:48:32 +02:00
Ronald S. Bultje
9ee2ddd773 vp9_parse: fix parsing of pskip and profile 2/3.
The fate results change because we now correctly timestamp the pskip
frames, which means the results are now identical to -vsync 0.
2015-09-04 09:59:17 -04:00
Ronald S. Bultje
10142f994a libvpxdec: explicitly signal RGB. 2015-09-04 09:33:46 -04:00
Ronald S. Bultje
4ecb8b4191 vp9: don't erase values for {lf,ref,skip,q}_enabled if segmentation=0.
Instead, use segmentation.enabled before accessing each of these values.
2015-09-04 09:33:45 -04:00
Ronald S. Bultje
8b45e87f64 vp9: fix segmentation map retention across keyframe boundaries. 2015-09-04 09:33:45 -04:00
Ronald S. Bultje
7cc7d13fe3 vp9: fix RGB chroma subsampling. 2015-09-04 09:33:45 -04:00
Ronald S. Bultje
ecd9f57edc vp9: read reserved bit in RGB header. 2015-09-04 09:33:45 -04:00