diff options
author | Anton Khirnov <anton@khirnov.net> | 2012-07-14 09:25:33 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2012-07-22 09:14:05 +0200 |
commit | d4f89906e3b310609b636cf6071313ec557ec873 (patch) | |
tree | af879b33d3d8b1fdf14c517bfb1317f349042b15 /libavfilter/vf_libopencv.c | |
parent | e9b992d035b58209d66115bd7d964741dd31d592 (diff) | |
download | ffmpeg-streaming-d4f89906e3b310609b636cf6071313ec557ec873.zip ffmpeg-streaming-d4f89906e3b310609b636cf6071313ec557ec873.tar.gz |
lavfi: add error handling to end_frame().
Diffstat (limited to 'libavfilter/vf_libopencv.c')
-rw-r--r-- | libavfilter/vf_libopencv.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/libavfilter/vf_libopencv.c b/libavfilter/vf_libopencv.c index aa30d36..e60caf2 100644 --- a/libavfilter/vf_libopencv.c +++ b/libavfilter/vf_libopencv.c @@ -354,7 +354,7 @@ static av_cold void uninit(AVFilterContext *ctx) memset(ocv, 0, sizeof(*ocv)); } -static void end_frame(AVFilterLink *inlink) +static int end_frame(AVFilterLink *inlink) { AVFilterContext *ctx = inlink->dst; OCVContext *ocv = ctx->priv; @@ -362,14 +362,17 @@ static void end_frame(AVFilterLink *inlink) AVFilterBufferRef *inpicref = inlink ->cur_buf; AVFilterBufferRef *outpicref = outlink->out_buf; IplImage inimg, outimg; + int ret; fill_iplimage_from_picref(&inimg , inpicref , inlink->format); fill_iplimage_from_picref(&outimg, outpicref, inlink->format); ocv->end_frame_filter(ctx, &inimg, &outimg); fill_picref_from_iplimage(outpicref, &outimg, inlink->format); - ff_draw_slice(outlink, 0, outlink->h, 1); - ff_end_frame(outlink); + if ((ret = ff_draw_slice(outlink, 0, outlink->h, 1)) < 0 || + (ret = ff_end_frame(outlink)) < 0) + return ret; + return 0; } AVFilter avfilter_vf_ocv = { |