diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index c2359b8a4d..67a6e3f9d0 100644 --- a/libavcodec/pngdec.c +++ b/libavcodec/pngdec.c @@ -1366,7 +1366,7 @@ static int decode_frame_png(AVCodecContext *avctx, } if ((ret = av_frame_ref(data, s->picture.f)) < 0) - return ret; + goto the_end; *got_frame = 1;