Originally committed as revision 24385 to svn://svn.ffmpeg.org/ffmpeg/trunk
Showing the changes to libavfilter/vsrc_buffer.c (1 of 1 file). Show all
Unified · Split
| @@ -62,12 +62,14 @@ int av_vsrc_buffer_add_frame(AVFilterContext *buffer_filter, AVFrame *frame, · 61 unmodified lines | ||
| 62 | 62 | static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) |
| 63 | 63 | { |
| 64 | 64 | BufferSourceContext *c = ctx->priv; |
| 65 | + int n = 0; | |
| 65 | 66 | |
| 66 | − if (args && sscanf(args, "%d:%d:%d", &c->w, &c->h, &c->pix_fmt) == 3) | |
| 67 | − return 0; | |
| 67 | + if (!args || (n = sscanf(args, "%d:%d:%d", &c->w, &c->h, &c->pix_fmt)) != 3) { | |
| 68 | + av_log(ctx, AV_LOG_ERROR, "Expected 3 arguments, but only %d found in '%s'\n", n, args ? args : ""); | |
| 69 | + return AVERROR(EINVAL); | |
| 70 | + } | |
| 68 | 71 | |
| 69 | − av_log(ctx, AV_LOG_ERROR, "init() expected 3 arguments:'%s'\n", args); | |
| 70 | − return -1; | |
| 72 | + return 0; | |
| 71 | 73 | } |
| 72 | 74 | |
| 73 | 75 | static int query_formats(AVFilterContext *ctx) |