Hi! Attached patch fixes ticket #8638 and the only other occurrence of fopen() without b in doc/examples.
Please comment, Carl Eugen
From c0ae8356baaf40dbf5d3312264b42b8f02c1561b Mon Sep 17 00:00:00 2001 From: Carl Eugen Hoyos <[email protected]> Date: Thu, 25 Jun 2020 00:01:36 +0200 Subject: [PATCH] doc/examples: Always open files as "binary", not "text". Fixes ticket #8638. --- doc/examples/decode_video.c | 2 +- doc/examples/hw_decode.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/examples/decode_video.c b/doc/examples/decode_video.c index 169188a4b9..18ee90a6c0 100644 --- a/doc/examples/decode_video.c +++ b/doc/examples/decode_video.c @@ -41,7 +41,7 @@ static void pgm_save(unsigned char *buf, int wrap, int xsize, int ysize, FILE *f; int i; - f = fopen(filename,"w"); + f = fopen(filename,"wb"); fprintf(f, "P5\n%d %d\n%d\n", xsize, ysize, 255); for (i = 0; i < ysize; i++) fwrite(buf + i * wrap, 1, xsize, f); diff --git a/doc/examples/hw_decode.c b/doc/examples/hw_decode.c index f3286f472d..71be6e6709 100644 --- a/doc/examples/hw_decode.c +++ b/doc/examples/hw_decode.c @@ -223,7 +223,7 @@ int main(int argc, char *argv[]) } /* open the file to dump raw data */ - output_file = fopen(argv[3], "w+"); + output_file = fopen(argv[3], "w+b"); /* actual decoding and dump the raw data */ while (ret >= 0) { -- 2.24.1
_______________________________________________ ffmpeg-devel mailing list [email protected] https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email [email protected] with subject "unsubscribe".
