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 | 329 | static int filter_frame(AVFilterLink *inlink, AVFrame *in) |
| 330 | 330 | { |
| 331 | + int err = 0; | |
| 331 | 332 | AVFilterContext *ctx = inlink->dst; |
| 332 | 333 | TransContext *s = ctx->priv; |
| 333 | 334 | AVFilterLink *outlink = ctx->outputs[0]; |
| @@ -339,10 +340,13 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) · 5 unmodified lines | ||
| 339 | 340 | |
| 340 | 341 | out = ff_get_video_buffer(outlink, outlink->w, outlink->h); |
| 341 | 342 | if (!out) { |
| 342 | − av_frame_free(&in); | |
| 343 | − return AVERROR(ENOMEM); | |
| 343 | + err = 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 | 351 | if (in->sample_aspect_ratio.num == 0) { |
| 348 | 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 | 360 | FFMIN(outlink->h, ff_filter_get_nb_threads(ctx))); |
| 357 | 361 | av_frame_free(&in); |
| 358 | 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 | 370 | #define OFFSET(x) offsetof(TransContext, x) |