This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch release/8.0
in repository ffmpeg.

commit 342747ac7dc6a6831621becd1d2c897574f81878
Author:     Jack Lau <[email protected]>
AuthorDate: Thu Aug 28 07:22:04 2025 +0800
Commit:     Jack Lau <[email protected]>
CommitDate: Tue Feb 10 09:32:56 2026 +0000

    avformat/whip: fix 8 bits overflow and map constraint_set bits for H264
    
    profile_iop is an 8 bits field. Previous code copied
    AVCodecParameters::profile (which can contain bits
    beyond 8 bits) into profile_iop, producing overflow
    and wrong values.
    
    This patch maps the constrained flags into the proper
    profile_iop bits (constraint_set1 / 3)
    
    Signed-off-by: Jack Lau <[email protected]>
    (cherry picked from commit 6c2768bf8c059126ea89ec14f1fe0c903f4f90c5)
---
 libavformat/whip.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/libavformat/whip.c b/libavformat/whip.c
index 885dc8acbb..b57d607a5b 100644
--- a/libavformat/whip.c
+++ b/libavformat/whip.c
@@ -594,7 +594,7 @@ static int parse_codec(AVFormatContext *s)
  */
 static int generate_sdp_offer(AVFormatContext *s)
 {
-    int ret = 0, profile, level, profile_iop;
+    int ret = 0, profile, level, profile_iop = 0;
     const char *acodec_name = NULL, *vcodec_name = NULL;
     AVBPrint bp;
     WHIPContext *whip = s->priv_data;
@@ -662,11 +662,12 @@ static int generate_sdp_offer(AVFormatContext *s)
     }
 
     if (whip->video_par) {
-        profile_iop = profile = whip->video_par->profile;
+        profile = whip->video_par->profile;
         level = whip->video_par->level;
         if (whip->video_par->codec_id == AV_CODEC_ID_H264) {
             vcodec_name = "H264";
-            profile_iop &= AV_PROFILE_H264_CONSTRAINED;
+            profile_iop |= profile & AV_PROFILE_H264_CONSTRAINED ? 1 << 6 : 0;
+            profile_iop |= profile & AV_PROFILE_H264_INTRA ? 1 << 4 : 0;
             profile &= (~AV_PROFILE_H264_CONSTRAINED);
         }
 

_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to