diff mbox

[FFmpeg-devel,v3,01/25] avformat/movenc: mov_write_ftyp_tag: write the major brand as a compatible brand

Message ID 1474291548-17810-2-git-send-email-erkki.seppala.ext@nokia.com
State Changes Requested
Headers show

Commit Message

erkki.seppala.ext@nokia.com Sept. 19, 2016, 1:25 p.m. UTC
when the option "brand" is used. This allows custom brands to end up in
the compatible brands as well.

Signed-off-by: Erkki Seppälä <erkki.seppala.ext@nokia.com>
Signed-off-by: OZOPlayer <OZOPL@nokia.com>
---
 libavformat/movenc.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Michael Niedermayer Nov. 5, 2016, 9:19 p.m. UTC | #1
On Mon, Sep 19, 2016 at 04:25:24PM +0300, Erkki Seppälä wrote:
> when the option "brand" is used. This allows custom brands to end up in
> the compatible brands as well.
> 
> Signed-off-by: Erkki Seppälä <erkki.seppala.ext@nokia.com>
> Signed-off-by: OZOPlayer <OZOPL@nokia.com>
> ---
>  libavformat/movenc.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/libavformat/movenc.c b/libavformat/movenc.c
> index 525d103..571c2a7 100644
> --- a/libavformat/movenc.c
> +++ b/libavformat/movenc.c
> @@ -4210,6 +4210,8 @@ static int mov_write_ftyp_tag(AVIOContext *pb, AVFormatContext *s)
>  
>      avio_wb32(pb, minor);
>  
> +    if (mov->mode == MODE_MP4 && mov->major_brand)
> +        ffio_wfourcc(pb, mov->major_brand); /* write major brand as a compatible brand */

missing length check, this would be writing uninitialized bytes
if it was nt 4 bytes long

[...]
diff mbox

Patch

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 525d103..571c2a7 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -4210,6 +4210,8 @@  static int mov_write_ftyp_tag(AVIOContext *pb, AVFormatContext *s)
 
     avio_wb32(pb, minor);
 
+    if (mov->mode == MODE_MP4 && mov->major_brand)
+        ffio_wfourcc(pb, mov->major_brand); /* write major brand as a compatible brand */
     if (mov->mode == MODE_MOV)
         ffio_wfourcc(pb, "qt  ");
     else if (mov->mode == MODE_ISM) {