summaryrefslogtreecommitdiff
path: root/libavcodec/pngdec.c
Commit message (Collapse)AuthorAge
* Merge commit '4fee11ab05fc8569ef35c0ce86a60375c903eefb'Hendrik Leppkes2015-08-05
|\ | | | | | | | | | | | | | | | | | | * commit '4fee11ab05fc8569ef35c0ce86a60375c903eefb': png: Be more informative regarding signature errors Conflicts: libavcodec/pngdec.c Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * png: Be more informative regarding signature errorsLuca Barbato2015-08-02
| | | | | | | | Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | Merge commit 'def97856de6021965db86c25a732d78689bd6bb0'Michael Niedermayer2015-07-27
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'def97856de6021965db86c25a732d78689bd6bb0': lavc: AV-prefix all codec capabilities Conflicts: cmdutils.c ffmpeg.c ffplay.c libavcodec/8svx.c libavcodec/aacenc.c libavcodec/ac3dec.c libavcodec/adpcm.c libavcodec/alac.c libavcodec/atrac3plusdec.c libavcodec/bink.c libavcodec/dnxhddec.c libavcodec/dvdec.c libavcodec/dvenc.c libavcodec/ffv1dec.c libavcodec/ffv1enc.c libavcodec/fic.c libavcodec/flacdec.c libavcodec/flacenc.c libavcodec/flvdec.c libavcodec/fraps.c libavcodec/frwu.c libavcodec/gifdec.c libavcodec/h261dec.c libavcodec/hevc.c libavcodec/iff.c libavcodec/imc.c libavcodec/libopenjpegdec.c libavcodec/libvo-aacenc.c libavcodec/libvorbisenc.c libavcodec/libvpxdec.c libavcodec/libvpxenc.c libavcodec/libx264.c libavcodec/mjpegbdec.c libavcodec/mjpegdec.c libavcodec/mpegaudiodec_float.c libavcodec/msmpeg4dec.c libavcodec/mxpegdec.c libavcodec/nvenc_h264.c libavcodec/nvenc_hevc.c libavcodec/pngdec.c libavcodec/qpeg.c libavcodec/ra288.c libavcodec/rv10.c libavcodec/s302m.c libavcodec/sp5xdec.c libavcodec/takdec.c libavcodec/tiff.c libavcodec/tta.c libavcodec/utils.c libavcodec/v210dec.c libavcodec/vp6.c libavcodec/vp9.c libavcodec/wavpack.c libavcodec/yop.c Merged-by: Michael Niedermayer <michael@niedermayer.cc>
| * lavc: AV-prefix all codec capabilitiesVittorio Giovara2015-07-27
| | | | | | | | | | | | Express bitfields more simply. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | apng: Fix decoding images with the PREVIOUS dispose opDonny Yang2015-07-22
| |
* | avcodec/apngdec: Fix typos in decoder causing incorrect resultsDonny Yang2015-07-20
| | | | | | | | Signed-off-by: Donny Yang <work@kota.moe>
* | avcodec/pngdec: Check values before updating context in decode_fctl_chunk()Michael Niedermayer2015-06-29
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/pngdec: Copy IHDR & plte state from last threadMichael Niedermayer2015-06-29
| | | | | | | | | | | | | | | | | | | | Previously these chunks where parsed again for each frame with threads but not without leading to a different path and the potential for inconsistencies This also removes a related special case from decode_ihdr_chunk() Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/pngdec: Require a IHDR chunk before fctlMichael Niedermayer2015-06-29
| | | | | | | | | | | | This is required by the APNG spec Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/pngdec: Only allow one IHDR chunkMichael Niedermayer2015-06-29
| | | | | | | | | | | | | | | | | | | | Multiple IHDR chunks are forbidden in PNG Fixes inconsistency and out of array accesses Fixes: asan_heap-oob_4d5c5a_1738_cov_2638287726_c-m2-8f2b481b7fd9bd745e620b7c01a18df2.png Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/apng: Add partial support for blending with PAL8 pixel formatDonny Yang2015-06-08
| | | | | | | | | | | | | | | | | | Currently restricted to blending pixels that only contain either 0 or 255 in their alpha components 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 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>