[vlc-commits] [Git][videolan/vlc][master] 2 commits: mux: mp4: reject non annexB H264 input

François Cartegnie (@fcartegnie) gitlab at videolan.org
Sun Dec 10 13:26:49 UTC 2023



François Cartegnie pushed to branch master at VideoLAN / VLC


Commits:
845fe4fc by François Cartegnie at 2023-12-10T13:02:48+00:00
mux: mp4: reject non annexB H264 input

- - - - -
4856d892 by François Cartegnie at 2023-12-10T13:02:48+00:00
mux: mp4: reject raw AAC without its extradata

- - - - -


1 changed file:

- modules/mux/mp4/libmp4mux.c


Changes:

=====================================
modules/mux/mp4/libmp4mux.c
=====================================
@@ -2317,7 +2317,6 @@ bool mp4mux_CanMux(vlc_object_t *p_obj, const es_format_t *p_fmt,
     case VLC_CODEC_A52:
     case VLC_CODEC_DTS:
     case VLC_CODEC_EAC3:
-    case VLC_CODEC_MP4A:
     case VLC_CODEC_MP4V:
     case VLC_CODEC_MPGA:
     case VLC_CODEC_MP2:
@@ -2344,9 +2343,29 @@ bool mp4mux_CanMux(vlc_object_t *p_obj, const es_format_t *p_fmt,
     case VLC_CODEC_WMAP:
     case VLC_CODEC_AV1:
         break;
+    case VLC_CODEC_MP4A:
+        if(!p_fmt->i_extra)
+        {
+            if(p_obj)
+                msg_Err(p_obj, "Missing AudioDescriptor for AAC");
+            return false;
+        }
+        break;
     case VLC_CODEC_H264:
-        if(!p_fmt->i_extra && p_obj)
+        if(p_fmt->i_extra)
+        {
+            /* we only accept annexB for now */
+            if(((const uint8_t*)p_fmt->p_extra)[0] == 0x01)
+            {
+                if(p_obj)
+                    msg_Err(p_obj, "H264 input is not annexB. Missing packetizer ?");
+                return false;
+            }
+        }
+        else if(p_obj)
+        {
             msg_Warn(p_obj, "H264 muxing from AnnexB source will set an incorrect default profile");
+        }
         break;
     case VLC_CODEC_HEVC:
         if(!p_fmt->i_extra)



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/76d2267c4902e305f5e8ad8c98f3f777480a924b...4856d89226c138e7395c5a762a50e1c3ffe6eb82

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/76d2267c4902e305f5e8ad8c98f3f777480a924b...4856d89226c138e7395c5a762a50e1c3ffe6eb82
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list