[FFmpeg-cvslog] Merge commit 'b8cd7a3c8df2c3aac8d7a0b5a02d83caf61bd769'

Clément Bœsch git at videolan.org
Mon Apr 3 22:01:58 EEST 2017


ffmpeg | branch: master | Clément Bœsch <u at pkh.me> | Mon Apr  3 20:57:03 2017 +0200| [9f7ba0ac9d2bacf16d8e26d41b23650d0d96ea64] | committer: Clément Bœsch

Merge commit 'b8cd7a3c8df2c3aac8d7a0b5a02d83caf61bd769'

* commit 'b8cd7a3c8df2c3aac8d7a0b5a02d83caf61bd769':
  dvbsub: Check for errors from system()

printf(...) replaced with fprintf(stderr, ...) for logging errors.

Merged-by: Clément Bœsch <u at pkh.me>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9f7ba0ac9d2bacf16d8e26d41b23650d0d96ea64
---

 libavcodec/dvbsubdec.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/libavcodec/dvbsubdec.c b/libavcodec/dvbsubdec.c
index 7c27d69..26985dd 100644
--- a/libavcodec/dvbsubdec.c
+++ b/libavcodec/dvbsubdec.c
@@ -85,10 +85,16 @@ static void png_save(const char *filename, uint32_t *bitmap, int w, int h)
     fclose(f);
 
     snprintf(command, sizeof(command), "pnmtopng -alpha %s %s > %s.png 2> /dev/null", fname2, fname, filename);
-    system(command);
+    if (system(command) != 0) {
+        fprintf(stderr, "Error running pnmtopng\n");
+        return;
+    }
 
     snprintf(command, sizeof(command), "rm %s %s", fname, fname2);
-    system(command);
+    if (system(command) != 0) {
+        fprintf(stderr, "Error removing %s and %s\n", fname, fname2);
+        return;
+    }
 }
 #endif
 


======================================================================

diff --cc libavcodec/dvbsubdec.c
index 7c27d69,e512b97..26985dd
--- a/libavcodec/dvbsubdec.c
+++ b/libavcodec/dvbsubdec.c
@@@ -85,10 -84,16 +85,16 @@@ static void png_save(const char *filena
      fclose(f);
  
      snprintf(command, sizeof(command), "pnmtopng -alpha %s %s > %s.png 2> /dev/null", fname2, fname, filename);
-     system(command);
+     if (system(command) != 0) {
 -        printf("Error running pnmtopng\n");
++        fprintf(stderr, "Error running pnmtopng\n");
+         return;
+     }
  
      snprintf(command, sizeof(command), "rm %s %s", fname, fname2);
-     system(command);
+     if (system(command) != 0) {
 -        printf("Error removing %s and %s\n", fname, fname2);
++        fprintf(stderr, "Error removing %s and %s\n", fname, fname2);
+         return;
+     }
  }
  #endif
  



More information about the ffmpeg-cvslog mailing list