Commit b8cd7a3c authored by Diego Biurrun's avatar Diego Biurrun

dvbsub: Check for errors from system()

libavcodec/dvbsubdec.c:145:5: warning: ignoring return value of ‘system’, declared with attribute warn_unused_result [-Wunused-result]
libavcodec/dvbsubdec.c:148:5: warning: ignoring return value of ‘system’, declared with attribute warn_unused_result [-Wunused-result]
parent 6427379f
......@@ -84,10 +84,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) {
printf("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);
return;
}
}
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment