vsrc_buffer: propagate error code in av_vsrc_buffer_add_frame()
authorStefano Sabatini <stefano.sabatini-lala@poste.it>
Thu, 2 Jun 2011 14:09:24 +0000 (16:09 +0200)
committerStefano Sabatini <stefano.sabatini-lala@poste.it>
Thu, 2 Jun 2011 16:48:28 +0000 (18:48 +0200)
Propagate av_vsrc_buffer_add_video_buffer_ref() error code rather than
return 0.

libavfilter/vsrc_buffer.c

index d1e6ffd..9ba7d4e 100644 (file)
@@ -111,15 +111,16 @@ int av_vsrc_buffer_add_video_buffer_ref(AVFilterContext *buffer_filter, AVFilter
 
 int av_vsrc_buffer_add_frame(AVFilterContext *buffer_src, const AVFrame *frame)
 {
+    int ret;
     AVFilterBufferRef *picref =
         avfilter_get_video_buffer_ref_from_frame(frame, AV_PERM_WRITE);
     if (!picref)
         return AVERROR(ENOMEM);
-    av_vsrc_buffer_add_video_buffer_ref(buffer_src, picref);
+    ret = av_vsrc_buffer_add_video_buffer_ref(buffer_src, picref);
     picref->buf->data[0] = NULL;
     avfilter_unref_buffer(picref);
 
-    return 0;
+    return ret;
 }
 #endif