diff mbox series

[FFmpeg-devel,18/32] avformat/fitsenc: Simplify writing header padding

Message ID AS8PR01MB7944E0FF0966F9D5D2D9B1D28FF99@AS8PR01MB7944.eurprd01.prod.exchangelabs.com
State Accepted
Commit 52af16bbf5386410872f45f17b25ecb9ff40b97f
Headers show
Series [FFmpeg-devel,01/32] fate/matroska: Use REMUX and TRANSCODE where appropriate | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Andreas Rheinhardt April 24, 2022, 3:34 a.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavformat/fitsenc.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/libavformat/fitsenc.c b/libavformat/fitsenc.c
index 5cf34ef067..37ee10bb13 100644
--- a/libavformat/fitsenc.c
+++ b/libavformat/fitsenc.c
@@ -24,6 +24,7 @@ 
  * FITS muxer.
  */
 
+#include "avio_internal.h"
 #include "internal.h"
 
 typedef struct FITSContext {
@@ -177,11 +178,7 @@  static int write_image_header(AVFormatContext *s)
     lines_written++;
 
     lines_left = ((lines_written + 35) / 36) * 36 - lines_written;
-    memset(buffer, ' ', 80);
-    while (lines_left > 0) {
-        avio_write(s->pb, buffer, sizeof(buffer));
-        lines_left--;
-    }
+    ffio_fill(s->pb, ' ', sizeof(buffer) * lines_left);
     return 0;
 }