Michael Niedermayer
82a60de3b7
avcodec/pngdec: handle 4 more bytes with SIMD for RGB64 in paeth prediction
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
ed9be7dd47
avcodec/x86/pngdsp: fix off by 1 error
...
This fixes artifacts in the last pixel of rows with some widths and pixel formats
Found-by: Dominique Leroux <Dominique.Leroux@autodesk.com>
Tested-by: Dominique Leroux <Dominique.Leroux@autodesk.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Benoit Fouet
4fa2758c79
avcodec/pngdec: check av_image_get_linesize return value
...
Fixes CID 1257012
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Benoit Fouet
0f6931f4b6
avcodec/pngdec: use memcpy instead of byte loops for P frames.
...
Rely on the way memcpy is optimized for one's system instead of looping
on a byte buffer for buffer copies to handle P frames.
Tested-by: Christophe Gisquet <christophe.gisquet@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Benoit Fouet
1d69ab9d1c
avcodec/pngdec: fix indentation in handle_row()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Benoit Fouet
6e9b060e4f
avcodec/pngdec: fix mem leak in init()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Benoit Fouet
08aec6f68e
libavcodec/pngdec: support 'previous' dispose operation for APNG.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Benoit Fouet
543fceba9c
apng: move shared header from avformat to avcodec.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Benoit Fouet
ebf2052a61
avcodec/pngdec: apng: fix output buffer filling when no blending is needed.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Benoit Fouet
af8804ac86
avcodec/pngdec: allow for some code path optimizations.
...
Use 'if (CONFIG_APNG_DECODER)' where needed, so that the compiler can
optimize out some portion of code.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Benoit Fouet
aff50ae1d1
avcodec/pngdec: do not blend on transparent black
...
There is no need to memset the zlib output buffer, as there is no
blending happening there. Instead, do not blend when the dispose
operation is set to 'background' (tranparent black).
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Benoit Fouet
cfd83a8af6
avcodec/pngdec: add support for 'over' blend operation for 'none' dispose operation.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Benoit Fouet
7dfee8d697
avcodec/pngdec: split P frames handling to a separate function.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
9a53707e86
avcodec/pngdec: Fix paeth prediction with small images
...
Fixes out of array read
Fixes: asan_heap-oob_20b0a06_1962_cov_1907976991_delete_node_small.png
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
79ceaf827b
avcodec/pngdec: Check IHDR/IDAT order
...
Fixes out of array access
Fixes: asan_heap-oob_20a6c26_2690_cov_3434532168_mail.png
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Benoit Fouet
33acebd3cc
avcodec/pngdec: add APNG support.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Benoit Fouet
00df32f6a9
avcodec/pngdec: split frame decoding in its own function.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Benoit Fouet
8cab24df07
avcodec/pngdec: create a function to handle small (<=4) bits per pixel values.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Benoit Fouet
24ca2ffad8
avcodec/pngdec: use else if instead of if for small bpp handling.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Benoit Fouet
c25b6ae8a2
avcodec/pngdec: fix some indentation/whitespaces
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Benoit Fouet
6499e63f7b
avcodec/pngdec: create a function to decode tRNS chunk.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Benoit Fouet
4f313a50ee
avcodec/pngdec: create a function to decode PLTE chunk.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Benoit Fouet
b35fa04152
avcodec/pngdec: create a function to decode IDAT chunk.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Benoit Fouet
3f1eaf590c
avcodec/pngdec: create a function to decode pHYs chunk.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Benoit Fouet
1523d1484d
avcodec/pngdec: create a function to decode IHDR chunk.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Benoit Fouet
98abb98cb1
avcodec/pngdec: rename decode_frame to decode_frame_png
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
e830902934
avcodec/pngdec: Calculate MPNG bytewidth more defensively
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
3e2b745020
avcodec/pngdec: Check bits per pixel before setting monoblack pixel format
...
Fixes out of array accesses
Fixes: asan_heap-oob_14dbfcf_4_asan_heap-oob_1ce5767_179_add_method_small.png
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
a6153bde3d
avcodec/pngdec: print the actual number of bytes left in the error case
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Vittorio Giovara
e64f0bf2d2
png: support reading gray+alpha at 16 bits
10 years ago
Vittorio Giovara
2257165bff
png: disable broken MMX/SIMD code for bpp <= 2
...
The decoder was producing different results when ASM was disabled.
Based on a long debug session with Kostya.
10 years ago
Vittorio Giovara
e96c3b81ca
avutil: rename AV_PIX_FMT_Y400A to AV_PIX_FMT_YA8
...
The rationale is that you have a packed format in form
<greyscale sample> <alpha sample> <greyscale sample> <alpha sample>
and shortening greyscale to 'G' might make one thing about Greenscale instead.
An alias pixel format and color space name are provided for compatibility.
10 years ago
Vittorio Giovara
92a36a6b33
pngdec: correctly indent macros
10 years ago
Michael Niedermayer
c163f5e601
avcodec/pngdec: fix () in OP_* macros
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Vittorio Giovara
c598b569fb
png: K&R formatting cosmetics
11 years ago
Carl Eugen Hoyos
666749f669
Decode png images without iend chunk.
...
Fixes ticket #3357 .
11 years ago
Michael Niedermayer
cb079b1b2b
avcodec/pngdec: fix signed overflow
...
fixes fate ftrapv failure
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Diego Biurrun
b2bed9325d
cosmetics: Group .name and .long_name together in codec/format declarations
11 years ago
Martin Storsjö
a81cad8f86
pngdec: Stop trying to decode once inflate returns Z_STREAM_END
...
If the input buffer contains more data after the deflate stream,
the loop previously left running infinitely, with inflate returning
Z_STREAM_END.
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
11 years ago
Michael Niedermayer
65bf9a44d7
avcodec/pngdec: check for stream end in png_decode_idat()
...
Fix infinite loop
Fix Ticket2978
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Paul B Mahol
7d7b4e8d5c
avcodec/png: remove obsolete comments
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
11 years ago
Michael Niedermayer
60fed98e63
avcodec/pngdec: fix last_row_size type
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
7b47d7f75e
avcodec/pngdec: Fix padded alloc code with threads
...
Fixes Ticket2903
Fixes out of array write
no releases should be affected by this
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Paul B Mahol
2a75459519
pngdec: do not release buffer on failure instead report full progress
...
Should fix heap-use-after-free as reported by Address Sanitizer.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
11 years ago
Paul B Mahol
dd1d29bd5f
pngdec: use av_fast_padded_malloc(z)
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
11 years ago
Paul B Mahol
6e643239d9
pngdec: frame multithreading support
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
11 years ago
Stefano Sabatini
0a3589bf2f
lavc/pngdec: return meaningful error codes
12 years ago
Michael Niedermayer
3b58ab4c5f
pngdec: dont treat mpng like png with key and non keyframes
...
Fixes Ticket2618
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Diego Biurrun
2832ea26f3
Remove commented-out debug #define cruft
12 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