]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/vf_drawtext.c
Merge commit 'ea031b75fb50c59196ccb654c9d143fb75365da9'
[ffmpeg] / libavfilter / vf_drawtext.c
index a955d0978178e3430fc1e383d7c6326820cc1e23..cf17a552f0bc90edabbd2c0878f220b3b2de5318 100644 (file)
@@ -682,8 +682,7 @@ static av_cold int init(AVFilterContext *ctx)
 
 static int query_formats(AVFilterContext *ctx)
 {
-    ff_set_common_formats(ctx, ff_draw_supported_pixel_formats(0));
-    return 0;
+    return ff_set_common_formats(ctx, ff_draw_supported_pixel_formats(0));
 }
 
 static int glyph_enu_free(void *opaque, void *elem)
@@ -1276,12 +1275,16 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
     int ret;
 
     if (s->reload) {
-        if ((ret = load_textfile(ctx)) < 0)
+        if ((ret = load_textfile(ctx)) < 0) {
+            av_frame_free(&frame);
             return ret;
+        }
 #if CONFIG_LIBFRIBIDI
         if (s->text_shaping)
-            if ((ret = shape_text(ctx)) < 0)
+            if ((ret = shape_text(ctx)) < 0) {
+                av_frame_free(&frame);
                 return ret;
+            }
 #endif
     }