Michael Niedermayer
8630b2cd36
avcodec/ffv1dec: Fix runtime error: signed integer overflow: 1550964438 + 1550964438 cannot be represented in type 'int'
...
Fixes: 1559/clusterfuzz-testcase-minimized-5048096079740928
Fixes: 1560/clusterfuzz-testcase-minimized-6011037813833728
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-05-13 23:28:33 +02:00
Michael Niedermayer
3a4d387195
avcodec/ffv1dec: Fix copying planes of paletted formats
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-05-08 03:25:17 +02:00
Clément Bœsch
549045254c
Fix all -Wformat warnings raised by DJGPP
2017-03-29 14:49:29 +02:00
Clément Bœsch
2f42aef3e4
Merge commit '17cb56b35672a2cd6ad7abe926e6cc772b8f4710'
...
* commit '17cb56b35672a2cd6ad7abe926e6cc772b8f4710':
ffv1: Remove broken disabled cruft
Merged-by: Clément Bœsch <u@pkh.me>
2017-03-19 15:58:43 +01:00
Carl Eugen Hoyos
322568c079
lavc/ffv1: Support YUV4xxP12 and GRAY12.
2016-11-20 22:23:01 +01:00
Michael Niedermayer
d1d18de6ad
avcodec/ffv1dec: Set packed_at_lsb for 16bit YUV
...
This avoids unneeded computations
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-11-18 18:04:28 +01:00
Michael Niedermayer
d7a3bb2088
avcodec/ffv1dec: Support gray 10/12/16 explicitly avoid shifts
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-11-18 18:04:28 +01:00
Carl Eugen Hoyos
55a424c5a8
lavc/ffv1dec: Scale output for msb-packed compression to full 16bit.
...
2% slowdown for existing decode-line timer.
2016-11-17 13:00:47 +01:00
Diego Biurrun
17cb56b356
ffv1: Remove broken disabled cruft
2016-08-17 12:16:42 +02:00
Michael Niedermayer
ce2217b25e
avcodec/ffv1: add AV_PIX_FMT_GBRP16 support
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-08 00:32:09 +02:00
Michael Niedermayer
74314f1f5f
avcodec/ffv1: template functions to allow data types different from int16_t
...
This is required for >= 16bit RGB support
I tried it without templates but its too much duplicated code
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-08 00:27:43 +02:00
Michael Niedermayer
697b2bbd54
avcodec/ffv1dec: Test extradata_size instead of extradata for better robustness
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-07-21 23:37:02 +02:00
Luca Barbato
3c08b7bc76
ffv1: Report additional bitstream information in verbose mode
...
Useful to inspect samples.
2016-06-29 07:21:07 +02:00
Jerome Martinez
ec9f04423b
ffv1: Error out on unsupported format
...
Transparency is supported only by YUV and within specific bit depths.
2016-06-18 12:46:43 +02:00
Jérôme Martinez
878c3a3645
avcodec/ffv1dec: fix some unsupported pix_fmt
...
When checking pix_fmt mapping, some bitstreams are mapped to an
incorrect pix_fmt instead of being rejected (ENOSYS).
Actually, such bitstreams are not supported (FFmpeg encoder does not
produce such bitstream, such bitstream may come only from another
encoder for the moment).
- JPEG 2000 RCT 11/13/15/16 bit depths are mapped to a 8-bit FFmpeg
pix_fmt (e.g. bgr0), which is not expected.
- JPEG 2000 RCT 9/10/12/14 bit depths with alpha are mapped to a
FFmpeg pix_fmt without alpha (e.g. AV_PIX_FMT_GBRP9 for 9-bit with
alpha), which is not expected.
The order for choosing the pix_fmt is changed to the one used by YCbCr
selection (<=8 bit first).
" && !f->transparency" is added to the other lines.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-06-13 22:07:35 +02:00
Derek Buitenhuis
21f9468402
avutil: Rename FF_CEIL_COMPAT to AV_CEIL_COMPAT
...
Libav, for some reason, merged this as a public API function. This will
aid in future merges.
A define is left for backwards compat, just in case some person
used it, since it is in a public header.
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-01-27 16:36:46 +00:00
Clément Bœsch
e8bc642202
lavu: add AV_CEIL_RSHIFT and use it in various places
...
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-01-11 15:32:56 -05:00
Michael Niedermayer
48985576b1
avcodec/ffv1dec: Support AV_PIX_FMT_YA8
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-01 01:32:06 +01:00
Derek Buitenhuis
bba2488f07
Merge commit '4bb1070c154e49d35805fbcdac9c9e92f702ef96'
...
* commit '4bb1070c154e49d35805fbcdac9c9e92f702ef96':
ffv1: Explicitly name the coder type
Conflicts:
libavcodec/ffv1.h
libavcodec/ffv1dec.c
libavcodec/ffv1enc.c
Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2015-11-22 16:57:43 +00:00
Vittorio Giovara
4bb1070c15
ffv1: Explicitly name the coder type
...
FFv1 uses two types of coders, golomb and range with two different
tables. This is exposed this in a rather convoluted way, for example
mentioning to set coder type 1 while initializing the variable 'ac' to 2,
because encoder does not use range coder with default table.
Appropriate internal coder type values have been added and used in any
check rather than using raw numbers.
Initialization of avctx.coder_type in ffv1dec is removed because this
field is encoder only. An unneeded validation check in the encoder
is dropped too.
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-11-16 12:56:31 +01:00
Michael Niedermayer
e04126072e
avcodec/ffv1dec: Clear quant_table_count if its invalid
...
Fixes deallocation of corrupted pointer
Fixes: 343dfbe142a38b521ed069dc4ea7c03b/signal_sigsegv_421427_4074_ffb11959610278cd40dbc153464aa254.avi
No releases affected
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-14 13:23:14 +01:00
Michael Niedermayer
a8b254e436
avcodec/ffv1dec: Print an error if the quant table count is invalid
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-05 01:31:52 +01:00
Michael Niedermayer
c665532820
avcodec/ffv1dec: Free tables on init failure
...
Fixes memleak
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>
2015-11-05 01:31:52 +01:00
Michael Niedermayer
5745cf799a
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>
2015-11-05 01:31:52 +01:00
Michael Niedermayer
5063a18f56
avcodec/ffv1dec: update progress in case of broken pointer chains
...
Fixes deadlock
Fixes Ticket4932
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-16 22:25:20 +02:00
Michael Niedermayer
4c2d4e8700
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>
2015-10-16 21:14:56 +02:00
Ganesh Ajjanagadde
2cbaa078d1
avcodec: use HAVE_THREADS header guards to silence -Wunused-function
...
When compiled with --disable-pthreads, e.g
http://fate.ffmpeg.org/report.cgi?time=20150917015044&slot=alpha-debian-qemu-gcc-4.7 ,
a bunch of -Wunused-functions are reported due to missing header guards
around threading related functions.
This patch should silence such warnings.
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-10-04 12:47:34 -04:00
Michael Niedermayer
2d221d9e06
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>
2015-09-26 13:42:04 +02:00
Michael Niedermayer
10bbf6cf62
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>
2015-09-26 13:42:04 +02:00
Michael Niedermayer
25df7b1c35
avcodec/ffv1dec: Fix >8bps error concealment
...
Fixes: 03_cave_girls_h264_slc24_slicecrc1_fuzzed.avi
Found-by: Dinah Handel <dinahrhandel@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-25 16:45:43 +02:00
Michael Niedermayer
b2955b6c5a
avcodec/rangecoder: Check e
...
Fixes hang.nut
Found-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-25 14:36:41 +02:00
Michael Niedermayer
aa6c43f3fd
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>
2015-09-24 23:53:02 +02:00
Hendrik Leppkes
5d8e836d0e
Replace all remaining occurances of step/depth_minus1 and offset_plus1
2015-09-08 17:10:48 +02:00
Michael Niedermayer
b7baebb754
avcodec/ffv1dec: Print CRCs at picture debug level
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-02 02:11:43 +02:00
Michael Niedermayer
eac161451d
avcodec/ffv1dec: Check that there is enough space for the CRC in the global header
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-02 02:10:31 +02:00
Timothy Gu
f0af25ae11
ffv1: Add missing ff_ prefixes
2015-08-22 08:36:20 -07:00
Michael Niedermayer
444e9874a7
Merge commit 'def97856de6021965db86c25a732d78689bd6bb0'
...
* commit 'def97856de6021965db86c25a732d78689bd6bb0':
lavc: AV-prefix all codec capabilities
Conflicts:
cmdutils.c
ffmpeg.c
ffplay.c
libavcodec/8svx.c
libavcodec/aacenc.c
libavcodec/ac3dec.c
libavcodec/adpcm.c
libavcodec/alac.c
libavcodec/atrac3plusdec.c
libavcodec/bink.c
libavcodec/dnxhddec.c
libavcodec/dvdec.c
libavcodec/dvenc.c
libavcodec/ffv1dec.c
libavcodec/ffv1enc.c
libavcodec/fic.c
libavcodec/flacdec.c
libavcodec/flacenc.c
libavcodec/flvdec.c
libavcodec/fraps.c
libavcodec/frwu.c
libavcodec/gifdec.c
libavcodec/h261dec.c
libavcodec/hevc.c
libavcodec/iff.c
libavcodec/imc.c
libavcodec/libopenjpegdec.c
libavcodec/libvo-aacenc.c
libavcodec/libvorbisenc.c
libavcodec/libvpxdec.c
libavcodec/libvpxenc.c
libavcodec/libx264.c
libavcodec/mjpegbdec.c
libavcodec/mjpegdec.c
libavcodec/mpegaudiodec_float.c
libavcodec/msmpeg4dec.c
libavcodec/mxpegdec.c
libavcodec/nvenc_h264.c
libavcodec/nvenc_hevc.c
libavcodec/pngdec.c
libavcodec/qpeg.c
libavcodec/ra288.c
libavcodec/rv10.c
libavcodec/s302m.c
libavcodec/sp5xdec.c
libavcodec/takdec.c
libavcodec/tiff.c
libavcodec/tta.c
libavcodec/utils.c
libavcodec/v210dec.c
libavcodec/vp6.c
libavcodec/vp9.c
libavcodec/wavpack.c
libavcodec/yop.c
Merged-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-27 22:50:18 +02:00
Vittorio Giovara
def97856de
lavc: AV-prefix all codec capabilities
...
Express bitfields more simply.
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-07-27 15:24:58 +01:00
Michael Niedermayer
cf52e6d012
avcodec/ffv1dec: Fix skip_alpha
...
Fixes Ticket4322
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-28 01:01:16 +02:00
Michael Niedermayer
d43cd6b08e
avcodec/ffv1dec: Check chroma shift parameters
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-04 14:31:45 +02:00
Michael Niedermayer
03baa861ea
avcodec/ffv1dec: More completely check micro_version
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-04 14:31:45 +02:00
Michael Niedermayer
3dfbdb328e
avcodec/ffv1dec: Check quant table symbols more completely
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-04 14:31:45 +02:00
Jérôme Martinez
14605a0b99
ffv1dec: plane_index is 1 in case of version 4 gray+alpha.
...
Since version 4, plane_index for the alpha plane is 1 in the case chroma_planes is 0.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-03 01:55:12 +02:00
James Almer
ba625dd8a1
avcodec: use av_mod_uintp2() where useful
...
Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: James Almer <jamrial@gmail.com>
2015-04-21 22:41:20 -03:00
Michael Niedermayer
8f7b022c8c
Merge commit '6a85dfc830f51f1f5c2d36d4182d265c1ea3ba25'
...
* commit '6a85dfc830f51f1f5c2d36d4182d265c1ea3ba25':
lavc: Replace av_dlog and tprintf with internal macros
Conflicts:
libavcodec/aacdec.c
libavcodec/audio_frame_queue.c
libavcodec/bitstream.c
libavcodec/dcadec.c
libavcodec/dnxhddec.c
libavcodec/dvbsubdec.c
libavcodec/dvdec.c
libavcodec/dvdsubdec.c
libavcodec/get_bits.h
libavcodec/gifdec.c
libavcodec/h264.h
libavcodec/h264_cabac.c
libavcodec/h264_cavlc.c
libavcodec/h264_loopfilter.c
libavcodec/h264_refs.c
libavcodec/imc.c
libavcodec/interplayvideo.c
libavcodec/jpeglsdec.c
libavcodec/libopencore-amr.c
libavcodec/mjpegdec.c
libavcodec/mpeg12dec.c
libavcodec/mpegvideo_enc.c
libavcodec/mpegvideo_parser.c
libavcodec/pngdec.c
libavcodec/ratecontrol.c
libavcodec/rv10.c
libavcodec/svq1dec.c
libavcodec/vqavideo.c
libavcodec/wmadec.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-20 04:10:10 +02:00
Vittorio Giovara
6a85dfc830
lavc: Replace av_dlog and tprintf with internal macros
2015-04-19 12:41:59 +01:00
Michael Niedermayer
f4cc19cdd0
Merge commit 'ca09effb01e126b0ac74ff3de70a475423ddee82'
...
* commit 'ca09effb01e126b0ac74ff3de70a475423ddee82':
ffv1: Drop unnecessary casts and const qualifiers to match function signatures
Conflicts:
libavcodec/ffv1dec.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-06 21:54:26 +01:00
Diego Biurrun
ca09effb01
ffv1: Drop unnecessary casts and const qualifiers to match function signatures
...
libavcodec/ffv1dec.c:898:36: warning: cast discards ‘const’ qualifier from pointer target type
2015-01-05 15:35:39 +01:00
Reimar Döffinger
8437cc7206
ffv1dec: Avoid unnecessarily large stack usage and copies.
...
Ideally the compiler could figure this out on its own,
but it seems it can't.
An alternative that would avoid the messy explicit memcpy
would be to use a sub-struct for the parts that should
be preserved, which can then simply be assigned.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2014-11-22 19:06:12 +01:00
Michael Niedermayer
113229922a
Merge commit 'da7d839a0d3ec40423a665dc85e0cfaed3f92eb8'
...
* commit 'da7d839a0d3ec40423a665dc85e0cfaed3f92eb8':
ffv1dec: check that global parameters do not change in version 0/1
Conflicts:
libavcodec/ffv1dec.c
See: b05cd1ea7e
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-12 17:09:39 +02:00