diff mbox series

[FFmpeg-devel,2/4] avcodec/dvbsubdec: fix writing ppm

Message ID 8da6e4ab17f452e5f066cb847ca9dd5cb80c94ef.1641530966.git.ffmpegagent@gmail.com
State New
Headers show
Series avcodec/dvbsubdec, dvdsubdec: don't dump images to disk based on DEBUG define | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Aman Karmani Jan. 7, 2022, 4:49 a.m. UTC
From: softworkz <softworkz@hotmail.com>

fopen needs (b)inary mode

Signed-off-by: softworkz <softworkz@hotmail.com>
---
 libavcodec/dvbsubdec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/dvbsubdec.c b/libavcodec/dvbsubdec.c
index 8db9963fda..f65bf960a4 100644
--- a/libavcodec/dvbsubdec.c
+++ b/libavcodec/dvbsubdec.c
@@ -1394,7 +1394,7 @@  static void png_save(DVBSubContext *ctx, const char *filename, uint32_t *bitmap,
 
     snprintf(fname, sizeof(fname), "%s.ppm", filename);
 
-    f = fopen(fname, "w");
+    f = fopen(fname, "wb");
     if (!f) {
         perror(fname);
         return;
@@ -1416,7 +1416,7 @@  static void png_save(DVBSubContext *ctx, const char *filename, uint32_t *bitmap,
 
     snprintf(fname2, sizeof(fname2), "%s-a.pgm", filename);
 
-    f = fopen(fname2, "w");
+    f = fopen(fname2, "wb");
     if (!f) {
         perror(fname2);
         return;