diff mbox series

[FFmpeg-devel] avformat/argo_asf: initialise file header inline

Message ID 20200914233053.2846-1-zane@zanevaniperen.com
State Accepted
Commit c79f07cc0c0b15252f13f56d61cf29c0081445b3
Headers show
Series [FFmpeg-devel] avformat/argo_asf: initialise file header inline | expand

Commit Message

Zane van Iperen Sept. 14, 2020, 11:31 p.m. UTC
Garbage was left-over in the ArgoASFFileHeader::name field if the url
was too short. This zero-initialises it.

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
---
 libavformat/argo_asf.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

Comments

Zane van Iperen Sept. 16, 2020, 12:53 a.m. UTC | #1
On Mon, 14 Sep 2020 23:31:00 +0000
"Zane van Iperen" <zane@zanevaniperen.com> wrote:

> 
> Garbage was left-over in the ArgoASFFileHeader::name field if the url
> was too short. This zero-initialises it.
> 
> Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>

Will apply soon.
diff mbox series

Patch

diff --git a/libavformat/argo_asf.c b/libavformat/argo_asf.c
index c131207aa1..b1632f3ba5 100644
--- a/libavformat/argo_asf.c
+++ b/libavformat/argo_asf.c
@@ -314,14 +314,15 @@  static int argo_asf_write_header(AVFormatContext *s)
 {
     const AVCodecParameters  *par = s->streams[0]->codecpar;
     ArgoASFMuxContext        *ctx = s->priv_data;
-    ArgoASFFileHeader  fhdr;
     ArgoASFChunkHeader chdr;
+    ArgoASFFileHeader  fhdr = {
+        .magic         = ASF_TAG,
+        .version_major = (uint16_t)ctx->version_major,
+        .version_minor = (uint16_t)ctx->version_minor,
+        .num_chunks    = 1,
+        .chunk_offset  = ASF_FILE_HEADER_SIZE
+    };
 
-    fhdr.magic         = ASF_TAG;
-    fhdr.version_major = (uint16_t)ctx->version_major;
-    fhdr.version_minor = (uint16_t)ctx->version_minor;
-    fhdr.num_chunks    = 1;
-    fhdr.chunk_offset  = ASF_FILE_HEADER_SIZE;
     /*
      * If the user specified a name, use it as is. Otherwise take the
      * basename and lop off the extension (if any).