Showing the changes to libavfilter (1 of 1 file). Show all
Unified · Split
| @@ -328,6 +328,7 @@ static int filter_slice(AVFilterContext *ctx, void *arg, int jobnr, · 327 unmodified lines | |||
| 328 | 328 | ||
| 329 | static int filter_frame(AVFilterLink *inlink, AVFrame *in) | 329 | static int filter_frame(AVFilterLink *inlink, AVFrame *in) |
| 330 | { | 330 | { |
| 331 | int err = 0; | ||
| 331 | AVFilterContext *ctx = inlink->dst; | 332 | AVFilterContext *ctx = inlink->dst; |
| 332 | TransContext *s = ctx->priv; | 333 | TransContext *s = ctx->priv; |
| 333 | AVFilterLink *outlink = ctx->outputs[0]; | 334 | AVFilterLink *outlink = ctx->outputs[0]; |
| @@ -339,10 +340,13 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) · 5 unmodified lines | |||
| 339 | 340 | ||
| 340 | out = ff_get_video_buffer(outlink, outlink->w, outlink->h); | 341 | out = ff_get_video_buffer(outlink, outlink->w, outlink->h); |
| 341 | if (!out) { | 342 | if (!out) { |
| 342 | av_frame_free(&in); | 343 | err = AVERROR(ENOMEM); |
| 343 | return AVERROR(ENOMEM); | 344 | goto fail; |
| 344 | } | 345 | } |
| 345 | av_frame_copy_props(out, in); | 346 | |
| 347 | err = av_frame_copy_props(out, in); | ||
| 348 | if (err < 0) | ||
| 349 | goto fail; | ||
| 346 | 350 | ||
| 347 | if (in->sample_aspect_ratio.num == 0) { | 351 | if (in->sample_aspect_ratio.num == 0) { |
| 348 | out->sample_aspect_ratio = in->sample_aspect_ratio; | 352 | out->sample_aspect_ratio = in->sample_aspect_ratio; |
| @@ -356,6 +360,11 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) · 7 unmodified lines | |||
| 356 | FFMIN(outlink->h, ff_filter_get_nb_threads(ctx))); | 360 | FFMIN(outlink->h, ff_filter_get_nb_threads(ctx))); |
| 357 | av_frame_free(&in); | 361 | av_frame_free(&in); |
| 358 | return ff_filter_frame(outlink, out); | 362 | return ff_filter_frame(outlink, out); |
| 363 | |||
| 364 | fail: | ||
| 365 | av_frame_free(&in); | ||
| 366 | av_frame_free(&out); | ||
| 367 | return err; | ||
| 359 | } | 368 | } |
| 360 | 369 | ||
| 361 | #define OFFSET(x) offsetof(TransContext, x) | 370 | #define OFFSET(x) offsetof(TransContext, x) |