diff mbox series

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

Message ID 0cd2c77f31faac220dd92a147b98c881f6c9a8e1.1641844533.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
andriy/make_aarch64_jetson success Make finished
andriy/make_fate_aarch64_jetson success Make fate finished
andriy/make_armv7_RPi4 success Make finished
andriy/make_fate_armv7_RPi4 success Make fate finished

Commit Message

Aman Karmani Jan. 10, 2022, 7:55 p.m. UTC
From: softworkz <softworkz@hotmail.com>

fopen needs (b)inary mode

Signed-off-by: softworkz <softworkz@hotmail.com>
---
 libavcodec/dvbsubdec.c | 4 ++--
 libavcodec/dvdsubdec.c | 2 +-
 2 files changed, 3 insertions(+), 3 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;
diff --git a/libavcodec/dvdsubdec.c b/libavcodec/dvdsubdec.c
index c0f796068e..f3d1a4e2fc 100644
--- a/libavcodec/dvdsubdec.c
+++ b/libavcodec/dvdsubdec.c
@@ -509,7 +509,7 @@  static void ppm_save(const char *filename, uint8_t *bitmap, int w, int h,
     int back[3] = {0, 255, 0};  /* green background */
     FILE *f;
 
-    f = fopen(filename, "w");
+    f = fopen(filename, "wb");
     if (!f) {
         perror(filename);
         return;