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 2096bb746683405e7ad7e7e7c8956d2621e58b87
Author:     Jack Lau <[email protected]>
AuthorDate: Thu Aug 28 07:40:40 2025 +0800
Commit:     Jack Lau <[email protected]>
CommitDate: Tue Feb 10 09:32:56 2026 +0000

    avformat/whip: fix potential 8bit overflow for profile_idc
    
    The profile contains profile_idc and constraint_set*_flag,
    throws away high 8 bit flags and then we get profile_idc.
    
    Signed-off-by: Jack Lau <[email protected]>
    (cherry picked from commit 785a4e0d6c80f475f7891d33dfa2927faa51da21)
---
 libavformat/whip.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/libavformat/whip.c b/libavformat/whip.c
index b57d607a5b..adfbfeff7d 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 = 0;
+    int ret = 0, profile_idc = 0, level, profile_iop = 0;
     const char *acodec_name = NULL, *vcodec_name = NULL;
     AVBPrint bp;
     WHIPContext *whip = s->priv_data;
@@ -662,13 +662,12 @@ static int generate_sdp_offer(AVFormatContext *s)
     }
 
     if (whip->video_par) {
-        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 |= profile & AV_PROFILE_H264_CONSTRAINED ? 1 << 6 : 0;
-            profile_iop |= profile & AV_PROFILE_H264_INTRA ? 1 << 4 : 0;
-            profile &= (~AV_PROFILE_H264_CONSTRAINED);
+            profile_iop |= whip->video_par->profile & 
AV_PROFILE_H264_CONSTRAINED ? 1 << 6 : 0;
+            profile_iop |= whip->video_par->profile & AV_PROFILE_H264_INTRA ? 
1 << 4 : 0;
+            profile_idc = whip->video_par->profile & 0x00ff;
         }
 
         av_bprintf(&bp, ""
@@ -694,7 +693,7 @@ static int generate_sdp_offer(AVFormatContext *s)
             whip->video_payload_type,
             vcodec_name,
             whip->video_payload_type,
-            profile,
+            profile_idc,
             profile_iop,
             level,
             whip->video_ssrc,

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

Reply via email to