diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index 986cde3719..9b236a245b 100644 --- a/libavcodec/pngdec.c +++ b/libavcodec/pngdec.c @@ -888,7 +888,7 @@ exit_loop: metadata = NULL; if ((ret = av_frame_ref(data, s->picture.f)) < 0) - return ret; + goto the_end; *got_frame = 1;