Signed-off-by: Ganesh Ajjanagadde <gajjanaga...@gmail.com>
---
 libavfilter/vf_paletteuse.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/libavfilter/vf_paletteuse.c b/libavfilter/vf_paletteuse.c
index 1225a66..a5449df 100644
--- a/libavfilter/vf_paletteuse.c
+++ b/libavfilter/vf_paletteuse.c
@@ -525,7 +525,13 @@ static int disp_tree(const struct color_node *node, const 
char *fname)
     av_bprintf(&buf, "}\n");
 
     fwrite(buf.str, 1, buf.len, f);
-    fclose(f);
+    if (fclose(f)) {
+        int ret = AVERROR(errno);
+        av_log(NULL, AV_LOG_ERROR,
+               "Unable to close file '%s', loss of information possible: %s\n",
+               fname, av_err2str(AVERROR(errno)));
+        return ret;
+    }
     av_bprint_finalize(&buf, NULL);
     return 0;
 }
-- 
2.7.0

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to