[FFmpeg-devel] [PATCH] lavfi/buffersink: check av_frame_ref() failure.

Nicolas George nicolas.george at normalesup.org
Wed Mar 20 11:41:51 CET 2013


Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
---
 libavfilter/buffersink.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavfilter/buffersink.c b/libavfilter/buffersink.c
index 9bbc8d9..bcb6525 100644
--- a/libavfilter/buffersink.c
+++ b/libavfilter/buffersink.c
@@ -137,7 +137,8 @@ int attribute_align_arg av_buffersink_get_frame_flags(AVFilterContext *ctx, AVFr
 
     if (flags & AV_BUFFERSINK_FLAG_PEEK) {
         cur_frame = *((AVFrame **)av_fifo_peek2(buf->fifo, 0));
-        av_frame_ref(frame, cur_frame); /* TODO check failure */
+        if ((ret = av_frame_ref(frame, cur_frame)) < 0)
+            return ret;
     } else {
         av_fifo_generic_read(buf->fifo, &cur_frame, sizeof(cur_frame), NULL);
         av_frame_move_ref(frame, cur_frame);
-- 
1.7.10.4



More information about the ffmpeg-devel mailing list