1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00
Commit Graph

105 Commits

Author SHA1 Message Date
Andreas Rheinhardt
20f9727018 avcodec/codec_internal: Add FFCodec, hide internal part of AVCodec
Up until now, codec.h contains both public and private parts
of AVCodec. This exposes the internals of AVCodec to users
and leads them into the temptation of actually using them
and forces us to forward-declare structures and types that
users can't use at all.

This commit changes this by adding a new structure FFCodec to
codec_internal.h that extends AVCodec, i.e. contains the public
AVCodec as first member; the private fields of AVCodec are moved
to this structure, leaving codec.h clean.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-03-21 01:33:09 +01:00
Michael Niedermayer
ca9025f374 avcodec/dpx: fix off by 1 in bits_per_color check
Fixes: CID1476303 Bad bit shift operation
Fixes: 34871/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DPX_fuzzer-6331163028357120

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-06-08 18:00:05 +02:00
Andreas Rheinhardt
a247ac640d avcodec: Constify AVCodecs
Given that the AVCodec.next pointer has now been removed, most of the
AVCodecs are not modified at all any more and can therefore be made
const (as this patch does); the only exceptions are the very few codecs
for external libraries that have a init_static_data callback.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:15 -03:00
Michael Niedermayer
c093eb3031 avcodec/dpx: Check bits_per_color earlier
Fixes: shift exponent 251 is too large for 32-bit type 'int'
Fixes: 32147/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DPX_fuzzer-5519111675314176

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-04-17 16:53:17 +02:00
Paul B Mahol
d1802e263c avcodec/dpx: add support for other single component 8bit files 2021-02-12 20:43:51 +01:00
Paul B Mahol
68fa294bf8 avcodec/dpx: add float support for single components and rgb(a) 2021-02-12 20:43:51 +01:00
James Almer
20b09b20a9 avcodec/dpx: fix use of uninitialised value
Found by Valgrind.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2020-12-18 15:22:16 -03:00
Harry Mallon
331858d0f6 avcodec/dpx: Fix B&W film scans from Lasergraphics Inc
Signed-off-by: Harry Mallon <harry.mallon@codex.online>
2020-12-17 13:02:49 +01:00
Harry Mallon
0539f15bbb avcodec/dpx: Read color information from DPX header
Signed-off-by: Harry Mallon <harry.mallon@codex.online>
2020-12-17 13:02:49 +01:00
Harry Mallon
8232e01e41 avcodec/dpx: Report color_range from DPX header
Signed-off-by: Harry Mallon <harry.mallon@codex.online>
2020-12-17 13:02:49 +01:00
Harry Mallon
a041c0a031 avcodec/dpx: Read SMPTE timecode from DPX
Signed-off-by: Harry Mallon <harry.mallon@codex.online>
2020-12-17 13:02:49 +01:00
Harry Mallon
6623421454 avcodec/dpx: Read alternative frame rate from television header
Signed-off-by: Harry Mallon <harry.mallon@codex.online>
2020-12-17 13:02:49 +01:00
Paul B Mahol
b88ed73be1 avcodec/dpx: fix spotted code style issues 2018-12-07 19:44:57 +01:00
Paul B Mahol
61e6226a5a avcodec/dpx: add support for special encoding 2018-12-07 19:44:57 +01:00
Paul B Mahol
788e116c2f avcodec/dpx: improve decoding of 10 bit gray images 2018-12-07 19:44:57 +01:00
Paul B Mahol
f628970e40 avcodec/dpx: add support for another gray10 variant 2018-12-07 19:44:57 +01:00
Paul B Mahol
9c881cf9a5 avcodec/dpx: parse input device name 2018-12-07 19:44:57 +01:00
Paul B Mahol
abb0306bf3 avcodec/dpx: parse image creator 2018-12-07 19:44:57 +01:00
Paul B Mahol
0f8383005c avcodec/dpx: check version of format header too 2018-12-07 19:44:57 +01:00
Paul B Mahol
ed5680f37e avcodec/dpx: add support for 10bit gray 2018-12-04 21:05:14 +01:00
Michael Niedermayer
75a2db5524 avcodec/dpx: Check elements in 12bps planar path
Fixes: null pointer dereference
Fixes: 8946/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DPX_fuzzer-5078915222601728

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Carl Eugen Hoyos <ceffmpeg@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-06-28 21:35:01 +02:00
Carl Eugen Hoyos
061e326b60 lavc/dpx: Support 10-bit packing method b (msbpad). 2018-06-21 17:41:48 +02:00
Carl Eugen Hoyos
af1e70dd66 lavc/dpx: Support 12-bit packing method b (msbpad). 2018-06-21 17:39:51 +02:00
Carl Eugen Hoyos
07d1c4ae3f lavc/dpx: Allow packed 12-bit little-endian images.
Can be tested with GraphicsMagick.
2018-06-16 16:18:06 +02:00
Carl Eugen Hoyos
78298bce70 lavc/dpx: Reset n_datum for every new line when decoding 12bit.
Fixes odd unpacked 12bit decoding.
Reported-by: Piotr Bandurski
2018-06-15 01:21:48 +02:00
Jérôme Martinez
5205b3289e avcodec/dpx: Support for RGBA 12-bit packed decoding
Limited to widths multiple of 2 due to lack of test files for such corner case

This partially fixes ticket #5639
2018-06-01 11:25:23 +02:00
Jérôme Martinez
b5788e7025 avcodec/dpx: Support for RGB 12-bit packed decoding
Limited to widths multiple of 8 (RGB) due to lack of test files for such corner case

This partially fixes ticket #5639

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-04-12 02:54:14 +02:00
Carl Eugen Hoyos
b1367f7e5e lavc/dpx: Support GRAY12 colourspace. 2016-11-14 00:33:12 +01:00
Carl Eugen Hoyos
aec96e233f lavc/dpx: Support decoding 12 bit colourspace with transparency information. 2016-06-15 17:45:51 +02:00
Carl Eugen Hoyos
d5ded429f2 lavc/dpx: Support decoding 10 bit colourspace with transparency information.
Fixes one sample from ticket #5639.
2016-06-14 17:02:34 +02:00
Michael Niedermayer
c8aaae8e0f avcodec/dpx: Move need_align to act per line
Fixes out of array read
Fixes: 61cf123c081ee2bb774d307c75bdb99e/asan_heap-oob_1224f76_5546_bee833ffae73f752b489b9eeaac52db7.dpx

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-14 16:12:15 +01: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
Carl Eugen Hoyos
2efaaf9476 Support decoding yuv dpx images. 2015-02-08 00:12:46 +01:00
Michael Niedermayer
18255441dd avcodec/dpx: fix framerate
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-15 16:08:36 +02:00
Christophe Gisquet
4ba45c189c dpx: use aligned line starts
SMPTE 268M-2003 specifies that each line starts at a 4-bytes boundary.
Therefore, modify correspondingly the input buffer strides and size.

Partially fixes ticket #3692: DLAD_8b_3c_big.dpx still has inverted
colors, which might be related to endianness.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-14 13:35:24 +02:00
Christophe Gisquet
7cdef77b50 dpx: warn if encrypted
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-14 04:31:07 +02:00
Michael Niedermayer
0dceefc5fa Merge commit '9e500efdbe0deeff1602500ebc229a0a6b6bb1a2'
* commit '9e500efdbe0deeff1602500ebc229a0a6b6bb1a2':
  Add av_image_check_sar() and use it to validate SAR

Conflicts:
	libavcodec/dpx.c
	libavcodec/dvdec.c
	libavcodec/ffv1dec.c
	libavcodec/utils.c
	libavutil/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-20 22:20:28 +02:00
Justin Ruggles
9e500efdbe Add av_image_check_sar() and use it to validate SAR 2014-06-20 10:39:33 -04:00
Reimar Döffinger
d90ba411ab dpx: use intfloat.h instead of deprecated intfloat_readwrite.h.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2014-05-13 20:53:24 +02:00
Michael Niedermayer
e0e60c9211 avcodec/dpx: extract frame rate
Fixes part of Ticket3511

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-25 23:40:59 +02:00
Michael Niedermayer
4a35651267 Merge commit 'd6da372984c87fd6288c148c291065d6032ceda3'
* commit 'd6da372984c87fd6288c148c291065d6032ceda3':
  eacmv: stop using deprecated avcodec_set_dimensions
  dvdsubdec: stop using deprecated avcodec_set_dimensions
  dvdec: stop using deprecated avcodec_set_dimensions
  dpx: stop using deprecated avcodec_set_dimensions

Conflicts:
	libavcodec/dpx.c
	libavcodec/dvdec.c
	libavcodec/dvdsubdec.c
	libavcodec/eacmv.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-01 14:01:02 +01:00
Anton Khirnov
8451b5f00a dpx: stop using deprecated avcodec_set_dimensions 2013-10-31 20:14:15 +01:00
Paul B Mahol
3abbf20962 dpx: abgr support
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2013-10-08 12:40:33 +00:00
Paul B Mahol
23824b9698 avcodec/dpx: support for 8 and 16 bit luma only files
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2013-10-07 11:45:46 +00:00
Paul B Mahol
e745dc2d6f avcodec/dpx: refactor pixel format selection
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2013-10-07 11:45:46 +00:00
Paul B Mahol
62078f25ee avcodec/dpx: return different error code for unsupported depths
Also give better message in such cases.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2013-10-07 09:10:00 +00:00
Paul B Mahol
ee3d03bf4e avcodec/dpx: make .long_name more descriptive
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2013-10-06 20:17:10 +00:00
Paul B Mahol
fc83c99c0b avcodec/dpx: cosmetics: fix identation
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2013-10-05 12:27:31 +00:00
Paul B Mahol
0841652b54 avcodec/dpx: reformat avpriv_report_missing_feature messages
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2013-10-05 12:26:45 +00:00