Signed-off-by: Ivan Efimov <ioefimov@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
... | ... |
@@ -1275,12 +1275,16 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame) |
1275 | 1275 |
int ret; |
1276 | 1276 |
|
1277 | 1277 |
if (s->reload) { |
1278 |
- if ((ret = load_textfile(ctx)) < 0) |
|
1278 |
+ if ((ret = load_textfile(ctx)) < 0) { |
|
1279 |
+ av_frame_free(&frame); |
|
1279 | 1280 |
return ret; |
1281 |
+ } |
|
1280 | 1282 |
#if CONFIG_LIBFRIBIDI |
1281 | 1283 |
if (s->text_shaping) |
1282 |
- if ((ret = shape_text(ctx)) < 0) |
|
1284 |
+ if ((ret = shape_text(ctx)) < 0) { |
|
1285 |
+ av_frame_free(&frame); |
|
1283 | 1286 |
return ret; |
1287 |
+ } |
|
1284 | 1288 |
#endif |
1285 | 1289 |
} |
1286 | 1290 |
|