diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-09-15 21:30:57 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-09-15 22:13:21 +0200 |
commit | 0da0b5e0f83df342f997b35e184ee456b6a7873e (patch) | |
tree | ca9372c3530f949472a7d51f50c3103a04415695 /libavcodec | |
parent | 5a627c14b53c520cda410d2cb1b64dc3158bf024 (diff) | |
download | ffmpeg-0da0b5e0f83df342f997b35e184ee456b6a7873e.tar.gz |
pngdec: av_log() zlib errors
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/pngdec.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index 67225bb7af..a5faeba42a 100644 --- a/libavcodec/pngdec.c +++ b/libavcodec/pngdec.c @@ -37,6 +37,7 @@ typedef struct PNGDecContext { PNGDSPContext dsp; + AVCodecContext *avctx; GetByteContext gb; AVFrame picture1, picture2; @@ -371,6 +372,7 @@ static int png_decode_idat(PNGDecContext *s, int length) while (s->zstream.avail_in > 0) { ret = inflate(&s->zstream, Z_PARTIAL_FLUSH); if (ret != Z_OK && ret != Z_STREAM_END) { + av_log(s->avctx, AV_LOG_ERROR, "inflate returned %d\n", ret); return -1; } if (s->zstream.avail_out == 0) { @@ -420,8 +422,10 @@ static int decode_frame(AVCodecContext *avctx, s->zstream.zfree = ff_png_zfree; s->zstream.opaque = NULL; ret = inflateInit(&s->zstream); - if (ret != Z_OK) + if (ret != Z_OK) { + av_log(avctx, AV_LOG_ERROR, "inflateInit returned %d\n", ret); return -1; + } for(;;) { if (bytestream2_get_bytes_left(&s->gb) <= 0) { av_log(avctx, AV_LOG_ERROR, "No bytes left\n"); @@ -723,6 +727,8 @@ static av_cold int png_dec_init(AVCodecContext *avctx) ff_pngdsp_init(&s->dsp); + s->avctx = avctx; + return 0; } |