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