[FFmpeg-devel] [PATCH 01/13] lavc/dvdsubdec: check fclose return value

Ganesh Ajjanagadde gajjanagadde at gmail.com
Tue Jan 12 05:25:03 CET 2016


Maybe theoretical; since the file is opened in read-only mode.
Nevertheless, it is a good idea to check the return value.

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde at gmail.com>
---
 libavcodec/dvdsubdec.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/dvdsubdec.c b/libavcodec/dvdsubdec.c
index 19f25f0..a5665c8 100644
--- a/libavcodec/dvdsubdec.c
+++ b/libavcodec/dvdsubdec.c
@@ -686,7 +686,8 @@ static int parse_ifo_palette(DVDSubContext *ctx, char *p)
         ret = AVERROR_INVALIDDATA;
     }
 end:
-    fclose(ifo);
+    if (fclose(ifo))
+        av_log(ctx, AV_LOG_WARNING, "Unable to close IFO file \"%s\": %s\n", p, av_err2str(AVERROR(errno)));
     return ret;
 }
 
-- 
2.7.0



More information about the ffmpeg-devel mailing list