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
Michael Niedermayer
f59ff8faa2
pngdec: use AVFrame accessor functions
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
1ac0fa50ef
pngdec/filter: dont access out of array elements at the end
...
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Carl Eugen Hoyos
3c3d68a976
Fix 1bpp palettized png with width not a multiple of 8.
...
Fixes ticket #2204 .
12 years ago
Anton Khirnov
9221c0af77
pngdec: cosmetics, reformat.
...
Also remove a commented out line.
12 years ago
Michael Niedermayer
9e36d9e4ed
pngdec: fix decoding of right column for 2/4bpp
...
Fixes Ticket1146
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
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
Michael Niedermayer
623cfc93d9
pngdec: check that format matches too not just dimensions
...
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Nicolas George
805b57001f
lavc/pngdec: decode textual data (tEXt and zTXt).
...
Requested in trac ticket #1857 .
12 years ago
Michael Niedermayer
b12d92efd6
avoid "0xFF << 24" as it is considered a integer overflow in C99
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Paul B Mahol
8288c2b6cb
pngdec: read sample aspect ratio
...
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
0da0b5e0f8
pngdec: av_log() zlib errors
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Anton Khirnov
36ef5369ee
Replace all CODEC_ID_* with AV_CODEC_ID_*
13 years ago
Paul B Mahol
a09ae4ef65
Remove duplicated png and mng signatures.
...
Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
13 years ago
Ronald S. Bultje
d2205d6543
png: check bit depth for PAL8/Y400A pixel formats.
...
Wrong bit depth can lead to invalid rowsize values, which crashes the
decoder further down.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
13 years ago
Michael Niedermayer
a63c813797
pngdec: check bits_per_pixel for palette mode.
...
This fixes a out of array read
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
c7dc19d68f
png: make sure the previous frames dimensions match before using it as reference
...
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 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
Paul B Mahol
25b67dc765
png: fix warning about discarding qualifiers [-Wincompatible-pointer-types]
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Clément Bœsch
50a3867bab
png: make ff_png_pass_mask local to pngdec.
13 years ago
Michael Niedermayer
8f394a6cf8
pngdec: print error message for truncated pngs even if we output them
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
4ed47d3354
pngdec: dont discard incomplete images.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
eeb792d862
pngdec: Print error messages for the various failure pathes.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Ronald S. Bultje
4c25269ced
png: convert to bytestream2 API.
...
Protects against overreads in the input buffer.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
13 years ago
Michael Niedermayer
39a3a53b66
pngdec: validate length.
...
Fixes out of array reading.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
8a08503b78
pngdec: Print error if signature is wrong.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Paul B Mahol
08630d25a2
png: make .long_name more descriptive
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Diego Biurrun <diego@biurrun.de>
13 years ago
Michael Niedermayer
146ef3f37c
pngdec: fix warning about pointer types
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Carl Eugen Hoyos
97da38c99b
Allow decoding of 64bit png images.
...
Fixes a part of ticket #639 .
13 years ago
Carl Eugen Hoyos
ea604de91e
Simplify "deloco" and support decoding of 48bit loco png.
13 years ago
Ronald S. Bultje
e92003514d
png: move DSP functions to their own DSP context.
13 years ago
Michael Niedermayer
49f2056289
pngdec: Convert 2/4 bit formats to 8bit.
...
This way 2 and 4 bit gray, rgb & rgba are supported.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
d1c48025a7
pngdec: Do not use SIMD paeth prediction for bpp=2
...
Fixes decoding of basi4a08.png
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
fd8a8373aa
pngdec: Fix masks for interlaced decoding
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
602e97dfaa
pngdec: Add some FF_DEBUG based av_logs.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Carl Eugen Hoyos
e209a37777
Simplify 32bit png decoding.
13 years ago
Paul B Mahol
e20a4881ff
pngdec: show verbose message for unsupported files
13 years ago
Carl Eugen Hoyos
613cbf3168
Fix some 1bit png samples, they can be palettised.
...
Fixes ticket #767 .
13 years ago
Carl Eugen Hoyos
0c5fd6372e
Do not try to read 16bit gray png files with alpha channel.
...
FFmpeg does not support gray16a.
Fixes the crash in ticket #644 .
13 years ago
Reimar Döffinger
371e165443
Try to set AVFrame.reference to correct values.
...
I am not sure these new values are correct, not am I sure
the semantics are a good idea since we do not seem to make any
use of them but they caused a lot of confusion, but this
seems to make things closer to matching the documentation.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
13 years ago
Michael Niedermayer
f962518036
pngdec: set reference correctly for corepng.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Carl Eugen Hoyos
f863cdef81
Cosmetics: Fix comment.
13 years ago
Michael Niedermayer
0c9cba24b7
pngdec: implement 4bpp interlaced
...
Fixes Ticket435
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
dcabb3d608
pngdec: implement 2 bpp interlaced.
...
Fixes Ticket434
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
bc6445f2db
pngdec: Fix interlaced PAETH prediction
...
Fixes Ticket161
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
2d4102fc13
pngdec: Implement 2bpp
...
Fixes Ticket433
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
dc43ad6d1a
pngdec: Fix interlaced 1bpp
...
Fixes Ticket214
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago