The branch, master has been updated
       via  b41f8207c4cfebf9bb6b66a9f354c8bbba3036b5 (commit)
      from  7fd967c2c1694d30dc131a372269be12fdf46f93 (commit)


- Log -----------------------------------------------------------------
commit b41f8207c4cfebf9bb6b66a9f354c8bbba3036b5
Author:     Jack Lau <[email protected]>
AuthorDate: Thu Sep 4 07:49:41 2025 +0800
Commit:     stevenliu <[email protected]>
CommitDate: Fri Sep 5 04:27:51 2025 +0000

    avformat/whip: fix SDP ICE candidates parsing
    
    fix issue #20407
    
    Refer to RFC 5245 15.1,
    the foundation may be any string up to 32 chars.
    The old code could misread foundations as transport("udp").
    This patch fully parse all these attr to avoid parsing error.
    
    Signed-off-by: Jack Lau <[email protected]>

diff --git a/libavformat/whip.c b/libavformat/whip.c
index e6b03b6a4b..587b6f8d41 100644
--- a/libavformat/whip.c
+++ b/libavformat/whip.c
@@ -865,12 +865,12 @@ static int parse_answer(AVFormatContext *s)
                 goto end;
             }
         } else if (av_strstart(line, "a=candidate:", &ptr) && 
!whip->ice_protocol) {
-            ptr = av_stristr(ptr, "udp");
             if (ptr && av_stristr(ptr, "host")) {
-                char protocol[17], host[129];
-                int priority, port;
-                ret = sscanf(ptr, "%16s %d %128s %d typ host", protocol, 
&priority, host, &port);
-                if (ret != 4) {
+                /* Refer to RFC 5245 15.1 */
+                char foundation[33], protocol[17], host[129];
+                int component_id, priority, port;
+                ret = sscanf(ptr, "%32s %d %16s %d %128s %d typ host", 
foundation, &component_id, protocol, &priority, host, &port);
+                if (ret != 6) {
                     av_log(whip, AV_LOG_ERROR, "Failed %d to parse line %d %s 
from %s\n",
                         ret, i, line, whip->sdp_answer);
                     ret = AVERROR(EIO);

-----------------------------------------------------------------------

Summary of changes:
 libavformat/whip.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)


hooks/post-receive
-- 

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

Reply via email to