aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/faxcompr.c
Commit message (Collapse)AuthorAgeFilesLines
* avutil/common: Don't auto-include mem.hAndreas Rheinhardt2024-03-311-0/+1
| | | | | | | | | | | There are lots of files that don't need it: The number of object files that actually need it went down from 2011 to 884 here. Keep it for external users in order to not cause breakages. Also improve the other headers a bit while just at it. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/faxcompr: Avoid superfluous VLC structuresAndreas Rheinhardt2023-10-311-18/+14
| | | | | | | | Of all these VLCs here, only VLC.table was really used after init, so use the ff_vlc_init_tables API to get rid of them. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/vlc: Use proper namespaceAndreas Rheinhardt2023-09-111-3/+3
| | | | | | | | | | | | | | | | Therefore use a proper prefix for this API, e.g. ff_init_vlc_sparse -> ff_vlc_init_sparse ff_free_vlc -> ff_vlc_free INIT_VLC_LE -> VLC_INIT_LE INIT_VLC_USE_NEW_STATIC -> VLC_INIT_USE_STATIC (The ancient INIT_VLC_USE_STATIC has been removed in 595324e143b57a52e2329eb47b84395c70f93087, so that the NEW has been dropped.) Finally, reorder the flags and change their values accordingly. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/vlc: Use structure instead of VLC_TYPE array as VLC elementAndreas Rheinhardt2022-06-171-2/+2
| | | | | | | | | | | | | | | | | | In C, qualifiers for arrays are broken: const VLC_TYPE (*foo)[2] is a pointer to an array of two const VLC_TYPE elements and unfortunately this is not compatible with a pointer to a const array of two VLC_TYPE, because the latter does not exist as array types are never qualified (the qualifier applies to the base type instead). This is the reason why get_vlc2() doesn't accept a const VLC table despite not modifying the table at all, as there is no automatic conversion from VLC_TYPE (*)[2] to const VLC_TYPE (*)[2]. Fix this by using a structure VLCElem for the VLC table. This also has the advantage of making it clear which element is which. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/faxcompr: Check for end of input in cmode == 1 in ↵Michael Niedermayer2021-08-101-0/+2
| | | | | | | | | | decode_group3_2d_line() Fixes: Infinite loop Fixes: 35591/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-4503764022198272 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/faxcompr: Check available bits in decode_uncompressed()Michael Niedermayer2021-06-121-0/+2
| | | | | | | | | Fixes: Timeout Fixes: 34950/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-5686764151898112 Fixes: 34966/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-4587409334468608 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/faxcompr: Check if bits are available before reading in cmode == 9 ↵Michael Niedermayer2021-06-121-1/+4
| | | | | | | | | | || cmode == 10 Fixes: Timeout Fixes: 34950/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-5686764151898112 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/faxcompr: Check for end of bitstream in decode_group3_1d_line() and ↵Michael Niedermayer2021-05-041-1/+6
| | | | | | | | | | decode_group3_2d_line() Fixes: infinite loop Fixes: 33674/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-4816457818046464 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/faxcompr: Check remaining bits on error in decode_group3_1d_line()Michael Niedermayer2021-04-221-1/+1
| | | | | | | | Fixes: Timeout Fixes: 32886/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-4779761466474496 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/faxcompr: Make ff_ccitt_unpack_init() thread-safeAndreas Rheinhardt2020-12-041-5/+8
| | | | | | | This will allow to make the TIFF decoder's init function thread-safe. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/faxcompr: Add missing runs check in decode_uncompressed()Michael Niedermayer2015-11-051-0/+4
| | | | | | | | Fixes out of array access Fixes: 54e488b9da4abbceaf405d6492515697/asan_heap-oob_32769b0_160_a8755eb08ee8f9579348501945a33955.TIF Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/faxcompr: negate uncompressed runsMichael Niedermayer2015-08-141-1/+1
| | | | | | | Fixes remaining part of Ticket700 Found-by: ami_stuff Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/faxcompr: Factor decode_uncompressed() outMichael Niedermayer2015-08-141-127/+85
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/faxcompr: Support uncompressed escapes in decode_group3_1d_line()Michael Niedermayer2015-08-131-2/+71
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/faxcompr: Support cmode == 9 && xxx == 7Michael Niedermayer2015-08-131-2/+72
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/faxcompr: Print the unsupported mode numberMichael Niedermayer2015-08-131-1/+2
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Fix buffer_size argument to init_put_bits() in multiple encoders.Dyami Caliri2015-02-261-1/+1
| | | | | | | Several encoders were multiplying the buffer size by 8, in order to get a bit size. However, the buffer_size argument is for the byte size of the buffer. We had experienced crashes encoding prores (Anatoliy) at size 4096x4096.
* avcodec/faxcompr: Fix memleakMichael Niedermayer2015-02-181-1/+1
| | | | | | Fixes CID1270816 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avcodec/faxcompr: use init_get_bits8()Paul B Mahol2015-02-071-1/+2
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avcodec/faxcompr: use av_malloc_array()Michael Niedermayer2014-04-121-2/+2
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* Merge remote-tracking branch 'qatar/master'Michael Niedermayer2013-06-081-19/+19
|\ | | | | | | | | | | | | | | | | | | * qatar/master: faxcompr: return meaningful errors Conflicts: libavcodec/faxcompr.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * faxcompr: return meaningful errorsLuca Barbato2013-06-071-19/+19
| | | | | | | | | | | | And optionally forward them to the caller instead of concealing them. Unify err and ret in a single variable.
* | Merge commit 'f32aefcf349f2f1367f0143782397643416d18f3'Michael Niedermayer2013-06-081-72/+79
|\| | | | | | | | | | | | | | | | | | | * commit 'f32aefcf349f2f1367f0143782397643416d18f3': faxcompr: K&R formatting cosmetics Conflicts: libavcodec/faxcompr.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * faxcompr: K&R formatting cosmeticsLuca Barbato2013-06-071-69/+75
| |
* | faxcompr: Dont read ref when the end has been reached in pass modeMichael Niedermayer2013-02-121-2/+4
| | | | | | | | | | | | | | Fixes reading over the end Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | tiffdec: Fix runend handlingMichael Niedermayer2012-12-241-3/+7
| | | | | | | | | | | | Fixes Ticket1999 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | faxcompr: fix out of array readMichael Niedermayer2012-09-071-1/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | faxcompr: fix byte alignment caseMichael Niedermayer2012-08-301-1/+2
| | | | | | | | | | | | | | Fixes Ticket1653 Found-by: ami_stuff Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | ccitt fax: fix some group3 1d files without EOLMichael Niedermayer2012-08-171-1/+3
| | | | | | | | | | | | Fixes Ticket832 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-04-131-5/+10
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: swscale: K&R formatting cosmetics (part II) tiffdec: Add a malloc check and refactor another. faxcompr: Check malloc results and unify return path configure: escape colons in values written to config.fate ac3dsp: call femms/emms at the end of float_to_fixed24() for 3DNow and SSE matroska: Fix leaking memory allocated for laces. pthread: Fix crash due to fctx->delaying not being cleared. vp3: Assert on invalid filter_limit values. h264: fix 10bit biweight functions after recent x86inc.asm fixes. ffv1: Fix size mismatch in encode_line. movenc: Remove a dead initialization git-howto: Explain how to avoid Windows line endings in git checkouts. build: Move all arch OBJS declarations into arch subdirectory Makefiles. Conflicts: configure libavcodec/vp3.c libavformat/matroskadec.c libavutil/Makefile libswscale/Makefile libswscale/swscale.c libswscale/swscale_internal.h libswscale/utils.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * faxcompr: Check malloc results and unify return pathAlex Converse2012-04-131-5/+10
| |
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-02-161-5/+5
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: (27 commits) ppc: Add ff_ prefix to nonstatic symbols sh4: Add ff_ prefix to nonstatic symbols mpegvideo: Add ff_ prefix to nonstatic functions rtjpeg: Add ff_ prefix to nonstatic symbols rv: Add ff_ prefix to nonstatic symbols vp56: Add ff_ prefix to nonstatic symbols vorbis: Add ff_ prefix to nonstatic symbols msmpeg4: Add ff_ prefix to nonstatic symbols vc1: Add ff_ prefix to nonstatic symbols msmpeg4: Add ff_ prefixes to nonstatic symbols snow: Add ff_ prefix to nonstatic symbols mpeg12: Add ff_ prefix to nonstatic symbols mpeg4: Add ff_ prefixes to nonstatic symbols lagarith: Add ff_ prefix to lag_rac_init libavcodec: Add ff_ prefix to j_rev_dct* dsputil: Add ff_ prefix to inv_zigzag_direct16 libavcodec: Prefix fdct_ifast, fdct_ifast248 dsputil: Add ff_ prefix to the dsputil*_init* functions libavcodec: Add ff_ prefix to some nonstatic symbols vlc/rl: Add ff_ prefix to the nonstatic symbols ... Conflicts: libavcodec/Makefile libavcodec/allcodecs.c libavcodec/dnxhddec.c libavcodec/ffv1.c libavcodec/h263.h libavcodec/h263dec.c libavcodec/h264.c libavcodec/mpegvideo.c libavcodec/mpegvideo_enc.c libavcodec/nuv.c libavcodec/ppc/dsputil_ppc.c libavcodec/proresdsp.c libavcodec/svq3.c libavcodec/version.h libavformat/dv.h libavformat/dvenc.c libavformat/matroskadec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * vlc/rl: Add ff_ prefix to the nonstatic symbolsMartin Storsjö2012-02-151-5/+5
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-07-151-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: configure: Automatically add more flags required on symbian mem.h: switch doxygen parameter order to match function prototype doxygen: replace @sa tag by the more readable but equivalent @see doxygen: use Doxygen markup for authors and web links where appropriate doxygen: do not include license boilerplate in Doxygen documentation ac3enc: Mark AVClasses const ffserver: Replace two loops with one loop. ffmpeg: Fix the check for experimental codecs swscale: extend mmx padding. swscale: clip unscaled colorspace conversion path. doxygen: misc consistency cosmetics doc: remove file name from @file directive in Doxygen usage example doxygen: consistently place brief description doxygen: place empty line between brief description and detailed description avformat_open_input(): Add braces to shut up gcc warning. Conflicts: libavcodec/8svx.c libavcodec/tiff.c libavcodec/tiff.h libavcodec/vaapi_h264.c libavcodec/vorbis.c libavcodec/vorbisdec.c libavcodec/vp6.c libswscale/swscale_unscaled.c libswscale/utils.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * doxygen: consistently place brief descriptionDiego Biurrun2011-07-141-1/+1
| |
| * Replace FFmpeg with Libav in licence headersMans Rullgard2011-03-191-4/+4
|/ | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
* Remove explicit filename from Doxygen @file commands.Diego Biurrun2010-04-201-1/+1
| | | | | | | | Passing an explicit filename to this command is only necessary if the documentation in the @file block refers to a file different from the one the block resides in. Originally committed as revision 22921 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Simplify r20025: use align_get_bits instead of reimplementing it.Reimar Döffinger2009-09-291-2/+2
| | | | Originally committed as revision 20079 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Make sure all the bits are written to output in fax data decoder.Kostya Shishkov2009-09-291-0/+1
| | | | | | | This fixes decoding TIFF images with fax compression and width being not multiple of eight (and issue 1429). Originally committed as revision 20072 to svn://svn.ffmpeg.org/ffmpeg/trunk
* cosmetics: reindent and reformat function declarationsKostya Shishkov2009-09-281-2/+3
| | | | Originally committed as revision 20066 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Finally distinguish TIFF_CCITT_RLE and TIFF_G3 1-D case, so both of themKostya Shishkov2009-09-281-2/+3
| | | | | | | will be decoded correctly. This fixes issue 1423. Originally committed as revision 20065 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Fix decoding of TIFF CCITT RLE compressed data.Kostya Shishkov2009-09-261-1/+3
| | | | | | This fixes issue 1417. Originally committed as revision 20025 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Rename bitstream.h to get_bits.h.Stefano Sabatini2009-04-131-1/+1
| | | | Originally committed as revision 18494 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Split bitstream.h, put the bitstream writer stuff in the new fileStefano Sabatini2009-04-121-0/+1
| | | | | | put_bits.h. Originally committed as revision 18461 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Use full internal pathname in doxygen @file directives.Diego Biurrun2009-02-011-1/+1
| | | | | | | Otherwise doxygen complains about ambiguous filenames when files exist under the same name in different subdirectories. Originally committed as revision 16912 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Add missing void keyword to parameterless function declarations.Diego Biurrun2009-01-301-1/+1
| | | | Originally committed as revision 16860 to svn://svn.ffmpeg.org/ffmpeg/trunk
* indentMichael Niedermayer2008-12-261-1/+1
| | | | Originally committed as revision 16348 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Simplify vertical modeMichael Niedermayer2008-12-261-3/+0
| | | | Originally committed as revision 16347 to svn://svn.ffmpeg.org/ffmpeg/trunk
* And another sechole ...Michael Niedermayer2008-12-261-1/+1
| | | | Originally committed as revision 16346 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Fix yet another sechole.Michael Niedermayer2008-12-261-3/+4
| | | | Originally committed as revision 16345 to svn://svn.ffmpeg.org/ffmpeg/trunk