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>
4 years ago
Carl Eugen Hoyos
ca781761d6
lavc/pnm: Allow decoding gray float pfm images.
4 years ago
Michael Niedermayer
ea28ce9bc1
avcodec/pnmdec: Fix misaligned reads
...
Found-by: "Steinar H. Gunderson" <steinar+ffmpeg@gunderson.no>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years ago
Paul B Mahol
d49db99ce2
avcodec: add PFM image decoder
5 years ago
Michael Niedermayer
49459aca47
avcodec/pnmdec: Use unsigned for maxval rescaling
...
Fixes: signed integer overflow: 65535 * 55335 cannot be represented in type 'int'
Fixes: 21955/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PGMYUV_fuzzer-5669206981083136
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
Carl Eugen Hoyos
193143486e
lavc/pnmdec: Fix 16bit decoding.
...
Regression since cdb5479c
Reported by irc user tTh from Mixart-Myrys
5 years ago
Andreas Cadhalpun
cdb5479c9d
pnmdec: make sure v is capped by maxval
...
Otherwise put_bits can be called with a value that doesn't fit in the
sample_len, causing an assertion failure.
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
8 years ago
Paul B Mahol
e7bc9623e5
avcodec/pnmdec: fix undefined behaviour
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
8 years ago
Vittorio Giovara
def97856de
lavc: AV-prefix all codec capabilities
...
Express bitfields more simply.
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
9 years ago
Carl Eugen Hoyos
6c559a0a9d
lavc/pnm: Support decoding ya16.
10 years ago
Diego Biurrun
b2bed9325d
cosmetics: Group .name and .long_name together in codec/format declarations
11 years ago
Michael Niedermayer
4fb3e1a652
avcodec/pnmdec: fix unaligned read
...
Fixes fate-lavf-pam on alpha
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
62d07bb321
avcodec/pnmdec: use a more specific pointer type than void in samplecpy()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Carl Eugen Hoyos
4c15f3491f
Set bits_per_raw_sample when decoding pnm.
11 years ago
Carl Eugen Hoyos
34d48dac25
avcodec/pnmdec: support more pnm files
...
Fixes Ticket1897
Some hunks that have become unneeded due to previous changes removed by the commiter.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
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
Carl Eugen Hoyos
2c046c718a
Revert "Avoid overflows when reading pgm files with maxval != 255 and != 65535."
...
The patch worked on little endian because pgm decoding was broken
but it was not correct in any way.
This reverts commit 7651c0e49b
.
11 years ago
Carl Eugen Hoyos
7651c0e49b
Avoid overflows when reading pgm files with maxval != 255 and != 65535.
...
libjpeg v6b apparently does not initialize the most significant bits
to zero when writing 12bit pgm's with maxval 4095.
11 years ago
Clément Bœsch
1ec94b0f06
lavc: factorize ff_{thread_,re,}get_buffer error messages.
...
Coccinelle profile used:
@@
expression r, ctx, f, loglevel, str, flags;
@@
-if ((r = ff_get_buffer(ctx, f, flags)) < 0) {
- av_log(ctx, loglevel, str);
- return r;
-}
+if ((r = ff_get_buffer(ctx, f, flags)) < 0)
+ return r;
@@
expression r, ctx, f, loglevel, str;
@@
-if ((r = ff_reget_buffer(ctx, f)) < 0) {
- av_log(ctx, loglevel, str);
- return r;
-}
+if ((r = ff_reget_buffer(ctx, f)) < 0)
+ return r;
@@
expression r, ctx, f, loglevel, str, flags;
@@
-if ((r = ff_thread_get_buffer(ctx, f, flags)) < 0) {
- av_log(ctx, loglevel, str);
- return r;
-}
+if ((r = ff_thread_get_buffer(ctx, f, flags)) < 0)
+ return r;
...along with some manual patches for the remaining ones.
12 years ago
Anton Khirnov
759001c534
lavc decoders: work with refcounted frames.
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
Anton Khirnov
df9b956751
lavc: fix decode_frame() third parameter semantics for video decoders
...
It's got_frame, not data size
12 years ago
Anton Khirnov
594d4d5df3
lavc: add a wrapper for AVCodecContext.get_buffer().
...
It will be useful in the upcoming transition to refcounted AVFrames.
12 years ago
Paul B Mahol
e2820d99f2
pnmdec: use more meaningful error codes
...
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
Michael Niedermayer
07cdd39478
pnmdec: use explicit casts to remove const to avoid warning with clang
...
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
Martin Storsjö
00c3b67b8a
cosmetics: Align codec declarations
...
Also break some long lines, remove codec function placeholder comments
and add spaces in sample/pixel format lists.
Signed-off-by: Martin Storsjö <martin@martin.st>
13 years ago
Diego Biurrun
324deaa268
Replace AVFrame pointer type punning by proper struct member assignments.
13 years ago
Diego Biurrun
562b6c744a
Remove unnecessary AVFrame pointer casts.
13 years ago
Paul B Mahol
0996f406c4
pnmdec: remove useless .pix_fmts
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
13 years ago
Michael Niedermayer
d9b3097ba2
pamdec: fix mono support.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Carl Eugen Hoyos
b614c14767
Simplify 32bit pam decoding.
...
Reviewed-by: Paul B Mahol
13 years ago
Paul B Mahol
aff9cb8377
lavc: remove unused headers
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
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
Anton Khirnov
ec6402b7c5
lavc: use designated initialisers for all codecs.
...
It's more readable and less prone to breakage.
13 years ago
Mans Rullgard
e23a05ab06
Fix incorrect max_lowres values
...
Signed-off-by: Mans Rullgard <mans@mansr.com>
14 years ago
Stefano Sabatini
554d3ad730
pnmdec: reindent after the previous commit
14 years ago
Stefano Sabatini
4a745b4177
pnmdec: add support for mono images with non-space-separated pixel digits
...
When the file to decode contains a sequence of binary values like
"1101110...", decode_frame() was reading the sequence of digits like a
unique integer value, which was resulting in integer overflows.
The change add support for parsing non-space-separated pixel digits
for mono formats, in particular fix decoding of file battrace.pbm, and
fix trac issue #154 .
14 years ago
Stefano Sabatini
ce5e49b0c2
replace deprecated FF_*_TYPE symbols with AV_PICTURE_TYPE_*
14 years ago
Stefano Sabatini
975a1447f7
Replace deprecated FF_*_TYPE symbols with AV_PICTURE_TYPE_*.
...
Signed-off-by: Diego Biurrun <diego@biurrun.de>
14 years ago
ami_stuff
e4f42f1f89
Remove lowres support from pnm decoder
...
The lowres support doesn't work correctly (crops the video), so let's remove it.
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
Diego Elio Pettenò
e7e2df27f8
Add ff_ prefix to data symbols of encoders, decoders, hwaccel, parsers, bsf.
...
None of these symbols should be accessed directly, so declare them as
hidden.
Signed-off-by: Mans Rullgard <mans@mansr.com>
(cherry picked from commit d36beb3f69
)
14 years ago
Diego Elio Pettenò
d36beb3f69
Add ff_ prefix to data symbols of encoders, decoders, hwaccel, parsers, bsf.
...
None of these symbols should be accessed directly, so declare them as
hidden.
Signed-off-by: Mans Rullgard <mans@mansr.com>
14 years ago
Måns Rullgård
8fc0162ac4
Add av_ prefix to bswap macros
...
Originally committed as revision 24170 to svn://svn.ffmpeg.org/ffmpeg/trunk
15 years ago
Måns Rullgård
e6b22522c9
bswap: change ME to NE in macro names
...
Other parts of FFmpeg use NE (native endian) rather than ME (machine).
This makes it consistent.
Originally committed as revision 24169 to svn://svn.ffmpeg.org/ffmpeg/trunk
15 years ago
Carl Eugen Hoyos
0fd0ef7947
Add new decoder property max_lowres and do not init decoder if requested value is higher.
...
Originally committed as revision 24098 to svn://svn.ffmpeg.org/ffmpeg/trunk
15 years ago