Andreas Rheinhardt
b9eaf77ed1
avcodec/internal: Move ff_set_dimensions() to decode.h
...
Decoder-only, as the dimensions are set by the user when encoding.
Also fixup the other headers a bit while removing unnecessary internal.h
inclusions.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2 years ago
Andreas Rheinhardt
22ca2ef018
avcodec/pnmdec, pnm_parser: Improve const-correctness
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2 years ago
Paul B Mahol
ff1450e449
avcodec: add PHM decoder and encoder
2 years ago
Carl Eugen Hoyos
ca781761d6
lavc/pnm: Allow decoding gray float pfm images.
4 years ago
Paul B Mahol
47be08640c
avcodec/pnm: disable check for PFM as it is not needed
4 years ago
Michael Niedermayer
8e21379da1
avcodec/pnm: Check scale
...
Fixes: division by zero
Fixes: 22974/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PFM_fuzzer-6270027077779456
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years ago
Paul B Mahol
d49db99ce2
avcodec: add PFM image decoder
5 years ago
Michael Niedermayer
c94cb8d9b2
avcodec/pnm: Check that the header is not truncated
...
Fixes: Ticket8430
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years ago
Michael Niedermayer
68f30567df
avcodec/pnm: skip reading trailing bytes in get_pnm()
...
None of the keys we support is that long and other keys
lead to decoder failure. None of the values is expected
to be longer, they are all numbers or short keywords.
This simplifies the code
Fixes: Timeout (9sec->43ms)
Fixes: 15177/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PAM_fuzzer-5080556716425216
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years ago
Michael Niedermayer
1a0f106232
avcodec/pnm: Check magic bytes directly without pnm_get()
...
Fixes: Timeout (10sec -> 30ms) (case 15089)
Fixes: 15089/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PBM_fuzzer-5767535057698816
Fixes: 16001/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PGM_fuzzer-5199169645445120
Fixes: 16003/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PGMYUV_fuzzer-5076443270217728
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years ago
Michael Niedermayer
14eea7c47a
avcodec/pnm: Optimize reading loop in pnm_get()
...
Fixes: Timeout 13149 (5sec -> 3sec), 13166 (11sec -> 7sec), 13430 (5sec -> 3sec)
Fixes: 13149/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PGM_fuzzer-5760833622114304
Fixes: 13166/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PGMYUV_fuzzer-5763216322330624
Fixes: 13430/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PPM_fuzzer-5758658334425088
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years ago
Michael Niedermayer
3f68948cb3
avcodec/pnm: Avoid structure pointer dereferences in inner loop in pnm_get()
...
Improves speed from 5.4 to 4.2 seconds
Fixes: 13149/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PGM_fuzzer-5760833622114304
Fixes: 13166/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PGMYUV_fuzzer-5763216322330624
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Lauri Kasanen <cand@gmx.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years ago
Michael Niedermayer
a1c0d1d906
avcodec/pnm: Use ff_set_dimensions()
...
Fixes: OOM
Fixes: 1906/clusterfuzz-testcase-minimized-4599315114754048
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 years ago
Andreas Cadhalpun
484151df7c
pnm: limit maxval to UINT16_MAX
...
From 'man ppm': The maximum color value (Maxval), again in ASCII decimal.
Must be less than 65536.
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
8 years ago
Carl Eugen Hoyos
6c559a0a9d
lavc/pnm: Support decoding ya16.
10 years ago
Michael Niedermayer
b4d525eb63
avcodec/pnm: check buf[0] before using buf[1]
...
Fixes CSA warning
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Anton Khirnov
afa21a12bf
p*menc: use the AVFrame API properly.
11 years ago
Michael Niedermayer
62738157dd
pnmdec: always output native pixel format
...
This simplifies the code
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Paul B Mahol
a5155294e5
pnm: do not set avctx->coded_frame
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
11 years ago
Paul B Mahol
329221eee7
pnm: fix 255 < maxval < 65535 for pam with depth 1
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
11 years ago
Paul B Mahol
768e40b451
Revert "pnm: remove nonsense code"
...
Breaks decoding pgms with 256 < maxval < 65535.
Found-by: Carl Eugen Hoyos <cehoyos@ag.or.at>.
This reverts commit a0348d0966
.
11 years ago
Carl Eugen Hoyos
7e8e8ba9cc
Assume gray8 if 1 < maxval <= 255 in pgm.
11 years ago
Anton Khirnov
e6c4ac7b5f
pixdesc: rename PIX_FMT_* flags to AV_PIX_FMT_FLAG_*
12 years ago
Anton Khirnov
759001c534
lavc decoders: work with refcounted frames.
12 years ago
Martin Storsjö
86611ff123
pnm: Use av_pix_fmt_desc_get instead of accessing the array directly
...
This fixes boken fate tests with MSVC with DLLs, broken since
b5f536d24
.
Signed-off-by: Martin Storsjö <martin@martin.st>
12 years ago
Michael Niedermayer
5ecf8189c6
pnm: use av_pix_fmt_desc_get()
...
Using the table directly may cause problems on some platforms like msvc
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Kostya Shishkov
b5f536d24b
pnm: add high-bitdepth PGMYUV support for both encoder and decoder
12 years ago
Anton Khirnov
380242ca50
pnm: return meaningful error codes.
12 years ago
Paul B Mahol
cc5bcaa48e
pnm: cosmetics: reindent
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
12 years ago
Paul B Mahol
ae5ecb8e60
pnm: remove duplicated check for maxval > 255
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
12 years ago
Paul B Mahol
a0348d0966
pnm: remove nonsense code
...
If maxval is more than 255 than each value takes 2 bytes with most
significant byte first.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
12 years ago
Anton Khirnov
716d413c13
Replace PIX_FMT_* -> AV_PIX_FMT_*, PixelFormat -> AVPixelFormat
12 years ago
Martin Storsjö
1d9c2dc89a
Don't include common.h from avutil.h
...
Signed-off-by: Martin Storsjö <martin@martin.st>
12 years ago
Michael Niedermayer
0049af2628
pnmdec: make ff_pnm_decode_header() more robust
...
Fixes ticket1321
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
bb7744a45b
pnmdec: make pnm_get more robust
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Anton Khirnov
36ef5369ee
Replace all CODEC_ID_* with AV_CODEC_ID_*
12 years ago
Diego Biurrun
562b6c744a
Remove unnecessary AVFrame pointer casts.
13 years ago
Michael Niedermayer
d9b3097ba2
pamdec: fix mono support.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Carl Eugen Hoyos
66b9d7065a
pam: Fix a typo that broke writing and reading PAM files.
...
Reported and reviewed by Derek Buitenhuis.
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
13 years ago
Carl Eugen Hoyos
b614c14767
Simplify 32bit pam decoding.
...
Reviewed-by: Paul B Mahol
13 years ago
Carl Eugen Hoyos
00430075bd
Support 64bit pam decoding.
13 years ago
Carl Eugen Hoyos
328e79329a
Support gray8a pam decoding.
13 years ago
Carl Eugen Hoyos
19b945dc2a
Cosmetics: Fix indentation.
...
Found by: Alexander Strasser
13 years ago
ami_stuff
febf75f3d2
pam: Reject 64bpp rgba.
...
Fixes ticket #883
13 years ago
ami_stuff
a44b63f6c8
Support 48bpp pam decoding.
...
Fixes ticket #882 .
13 years ago
ami_stuff
871e2f4fac
Support 16bpp grayscale pam decoding.
...
Fixes ticket #881 .
13 years ago
Carl Eugen Hoyos
190a0998c3
Fix a crash when reading gray pam files.
...
Fixes ticket #837 .
13 years ago
Carl Eugen Hoyos
c1bc1967f3
Fix a typo that broke writing (and reading) PAM files.
...
Reported and reviewed by Derek Buitenhuis.
13 years ago
Michael Niedermayer
0257ac8f12
pnm: Fix spurious error message.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
14 years ago
Mans Rullgard
2912e87a6c
Replace FFmpeg with Libav in licence headers
...
Signed-off-by: Mans Rullgard <mans@mansr.com>
14 years ago