summaryrefslogtreecommitdiff
path: root/libavcodec/pngdec.c
Commit message (Collapse)AuthorAge
...
* | avcodec/apng: Add support for blending with GRAY8A pixel formatDonny Yang2015-06-08
| | | | | | | | | | | | Signed-off-by: Donny Yang <work@kota.moe> Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/apng: Add blending support for non-alpha pixel formatsDonny Yang2015-06-08
| | | | | | | | | | | | Signed-off-by: Donny Yang <work@kota.moe> Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/apng: Dispose previous frame properlyDonny Yang2015-06-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The spec specifies the dispose operation as how the current (i.e., currently being rendered) frame should be disposed when the next frame is blended onto it This is contrary to ffmpeg's current behaviour of interpreting the dispose operation as how the previous (i.e., already rendered) frame should be disposed This patch fixes ffmpeg's behaviour to match those of the spec, which involved a rewrite of the blending function Signed-off-by: Donny Yang <work@kota.moe> Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/apng: Remove blending support for AV_PIX_FMT_ARGBDonny Yang2015-06-03
| | | | | | | | | | | | | | | | ARGB is not a supported PNG pixel format Signed-off-by: Donny Yang <work@kota.moe> Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'b9f7a677083647d85e583d6d7384938766a293d7'Michael Niedermayer2015-05-10
|\| | | | | | | | | | | | | | | | | | | | | * commit 'b9f7a677083647d85e583d6d7384938766a293d7': png: Set the color range as full range Conflicts: libavcodec/pngdec.c See: 72e7553125e61847d9cab77fb7de62440dca746b Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * png: Set the color range as full rangewm42015-05-09
| | | | | | | | | | | | The format uses full range for the gray formats. CC: libav-stable@libav.org
* | pngdec: set correct rangewm42015-05-08
| | | | | | | | | | | | | | | | | | | | AV_PIX_FMT_GRAY8/16 are considered YUV formats, and the color_range is not set - so the API user will have to assume limitted range. (Unless the API user adds a special-case for the PNG decoder.) Just export the correct range - full range. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | pngdec: don't use AV_PIX_FMT_MONOBLACK for apngAndreas Cadhalpun2015-05-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | AV_PIX_FMT_MONOBLACK has the AV_PIX_FMT_FLAG_BITSTREAM flag, i.e. linesize can be smaller than width. Since x_offset is only check against the width, this can lead to x_offset * bpp >= image_linesize. In this case ptr could be set to a position outside the image_buf in png_handle_row, leading to memory corruption and thus crashes. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | pngdec: return correct error code from decode_frame_commonAndreas Cadhalpun2015-05-03
| | | | | | | | | | | | | | | | During the loop ret can get changed. Since it is not set on all failure paths, decode_frame_common can return 0 even though an error occurred. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | pngdec: check s->last_picture.f->data[0] before using itAndreas Cadhalpun2015-05-03
| | | | | | | | | | | | | | | | | | | | | | This check was removed in commit 08aec6f6, but s->last_picture.f->data[0] is still used in handle_p_frame_apng unconditionally. This fixes a segmentation fault. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '6a85dfc830f51f1f5c2d36d4182d265c1ea3ba25'Michael Niedermayer2015-04-20
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '6a85dfc830f51f1f5c2d36d4182d265c1ea3ba25': lavc: Replace av_dlog and tprintf with internal macros Conflicts: libavcodec/aacdec.c libavcodec/audio_frame_queue.c libavcodec/bitstream.c libavcodec/dcadec.c libavcodec/dnxhddec.c libavcodec/dvbsubdec.c libavcodec/dvdec.c libavcodec/dvdsubdec.c libavcodec/get_bits.h libavcodec/gifdec.c libavcodec/h264.h libavcodec/h264_cabac.c libavcodec/h264_cavlc.c libavcodec/h264_loopfilter.c libavcodec/h264_refs.c libavcodec/imc.c libavcodec/interplayvideo.c libavcodec/jpeglsdec.c libavcodec/libopencore-amr.c libavcodec/mjpegdec.c libavcodec/mpeg12dec.c libavcodec/mpegvideo_enc.c libavcodec/mpegvideo_parser.c libavcodec/pngdec.c libavcodec/ratecontrol.c libavcodec/rv10.c libavcodec/svq1dec.c libavcodec/vqavideo.c libavcodec/wmadec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavc: Replace av_dlog and tprintf with internal macrosVittorio Giovara2015-04-19
| |
* | Merge commit '1e763454322f7fbc7799f6009bf2e11d7a3b9821'Michael Niedermayer2015-01-15
|\| | | | | | | | | | | | | | | | | | | | | | | * commit '1e763454322f7fbc7799f6009bf2e11d7a3b9821': png: improve signature check Conflicts: libavcodec/pngdec.c See: 8a08503b78f59d61cf98b9deb99363e3e07d8599 See: 0a3589bf2f0a23b0eb68664fbb00078abe882a88 Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * png: improve signature checkVittorio Giovara2015-01-14
| | | | | | | | | | Return proper error code, print an error message and add missing parentheses.
* | avcodec/pngdec: handle 4 more bytes with SIMD for RGB64 in paeth predictionMichael Niedermayer2014-12-08
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/x86/pngdsp: fix off by 1 errorMichael Niedermayer2014-12-08
| | | | | | | | | | | | | | | | 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>
* | avcodec/pngdec: check av_image_get_linesize return valueBenoit Fouet2014-12-08
| | | | | | | | | | | | Fixes CID 1257012 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/pngdec: use memcpy instead of byte loops for P frames.Benoit Fouet2014-12-04
| | | | | | | | | | | | | | | | 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>
* | avcodec/pngdec: fix indentation in handle_row()Benoit Fouet2014-12-04
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/pngdec: fix mem leak in init()Benoit Fouet2014-12-04
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | libavcodec/pngdec: support 'previous' dispose operation for APNG.Benoit Fouet2014-12-04
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | apng: move shared header from avformat to avcodec.Benoit Fouet2014-12-02
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/pngdec: apng: fix output buffer filling when no blending is needed.Benoit Fouet2014-11-28
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/pngdec: allow for some code path optimizations.Benoit Fouet2014-11-28
| | | | | | | | | | | | | | 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>
* | avcodec/pngdec: do not blend on transparent blackBenoit Fouet2014-11-28
| | | | | | | | | | | | | | | | 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>
* | avcodec/pngdec: add support for 'over' blend operation for 'none' dispose ↵Benoit Fouet2014-11-28
| | | | | | | | | | | | operation. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/pngdec: split P frames handling to a separate function.Benoit Fouet2014-11-28
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/pngdec: Fix paeth prediction with small imagesMichael Niedermayer2014-11-26
| | | | | | | | | | | | | | 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>
* | avcodec/pngdec: Check IHDR/IDAT orderMichael Niedermayer2014-11-26
| | | | | | | | | | | | | | 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>
* | avcodec/pngdec: add APNG support.Benoit Fouet2014-11-21
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/pngdec: split frame decoding in its own function.Benoit Fouet2014-11-14
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/pngdec: create a function to handle small (<=4) bits per pixel values.Benoit Fouet2014-11-14
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/pngdec: use else if instead of if for small bpp handling.Benoit Fouet2014-11-14
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/pngdec: fix some indentation/whitespacesBenoit Fouet2014-11-14
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/pngdec: create a function to decode tRNS chunk.Benoit Fouet2014-11-14
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/pngdec: create a function to decode PLTE chunk.Benoit Fouet2014-11-14
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/pngdec: create a function to decode IDAT chunk.Benoit Fouet2014-11-14
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/pngdec: create a function to decode pHYs chunk.Benoit Fouet2014-11-14
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/pngdec: create a function to decode IHDR chunk.Benoit Fouet2014-11-14
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/pngdec: rename decode_frame to decode_frame_pngBenoit Fouet2014-11-14
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/pngdec: Calculate MPNG bytewidth more defensivelyMichael Niedermayer2014-10-03
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/pngdec: Check bits per pixel before setting monoblack pixel formatMichael Niedermayer2014-10-03
| | | | | | | | | | | | | | | | 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>
* | avcodec/pngdec: print the actual number of bytes left in the error caseMichael Niedermayer2014-09-11
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'e64f0bf2d2b1347ec9461f0e82852a62e8c6ffbe'Michael Niedermayer2014-08-04
|\| | | | | | | | | | | | | * commit 'e64f0bf2d2b1347ec9461f0e82852a62e8c6ffbe': png: support reading gray+alpha at 16 bits Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * png: support reading gray+alpha at 16 bitsVittorio Giovara2014-08-04
| |
| * png: disable broken MMX/SIMD code for bpp <= 2Vittorio Giovara2014-08-04
| | | | | | | | | | The decoder was producing different results when ASM was disabled. Based on a long debug session with Kostya.
* | Merge commit 'e96c3b81cadd0ba84d43b1f3a54980df3785d9a5'Michael Niedermayer2014-08-04
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'e96c3b81cadd0ba84d43b1f3a54980df3785d9a5': avutil: rename AV_PIX_FMT_Y400A to AV_PIX_FMT_YA8 Conflicts: libavcodec/libopenjpegdec.c libavcodec/libopenjpegenc.c libavcodec/raw.c libavutil/pixdesc.c libavutil/pixfmt.h libavutil/version.h libswscale/swscale_internal.h libswscale/swscale_unscaled.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * avutil: rename AV_PIX_FMT_Y400A to AV_PIX_FMT_YA8Vittorio Giovara2014-08-04
| | | | | | | | | | | | | | 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.
* | Merge commit '92a36a6b3338df5f5cff573a486e182005367c24'Michael Niedermayer2014-08-01
|\| | | | | | | | | | | | | | | | | | | * commit '92a36a6b3338df5f5cff573a486e182005367c24': pngdec: correctly indent macros Conflicts: libavcodec/pngdec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * pngdec: correctly indent macrosVittorio Giovara2014-08-01
| |