Showing the changes to libavfilter (1 of 1 file). Show all
Unified · Split
| @@ -273,9 +273,16 @@ static av_cold int init_video(AVFilterContext *ctx) · 272 unmodified lines | ||
| 273 | 273 | { |
| 274 | 274 | BufferSourceContext *c = ctx->priv; |
| 275 | 275 | |
| 276 | − if (c->pix_fmt == AV_PIX_FMT_NONE || !c->w || !c->h || | |
| 277 | − av_q2d(c->time_base) <= 0) { | |
| 278 | − av_log(ctx, AV_LOG_ERROR, "Invalid parameters provided.\n"); | |
| 276 | + if (c->pix_fmt == AV_PIX_FMT_NONE) { | |
| 277 | + av_log(ctx, AV_LOG_ERROR, "Unspecified pixel format\n"); | |
| 278 | + return AVERROR(EINVAL); | |
| 279 | + } | |
| 280 | + if (c->w <= 0 || c->h <= 0) { | |
| 281 | + av_log(ctx, AV_LOG_ERROR, "Invalid size %dx%d\n", c->w, c->h); | |
| 282 | + return AVERROR(EINVAL); | |
| 283 | + } | |
| 284 | + if (av_q2d(c->time_base) <= 0) { | |
| 285 | + av_log(ctx, AV_LOG_ERROR, "Invalid time base %d/%d\n", c->time_base.num, c->time_base.den); | |
| 279 | 286 | return AVERROR(EINVAL); |
| 280 | 287 | } |
| 281 | 288 | |