The branch, release/7.1 has been updated
       via  f46e514491172d15bd74b4abb1814cd2f05a763e (commit)
       via  87e1bea70b4ba3fc54e614298bcc3c415c042c2e (commit)
       via  19bc0ef3f3ea33659ad9650e1424686c7931e44d (commit)
       via  bdc11c44b15be12f8eebef1cb3bfcda240a31d00 (commit)
      from  baee5f5e2751b61572abe23a8f8a0042d27c89e6 (commit)


- Log -----------------------------------------------------------------
commit f46e514491172d15bd74b4abb1814cd2f05a763e
Author:     Michael Niedermayer <[email protected]>
AuthorDate: Fri Nov 21 00:07:39 2025 +0100
Commit:     Michael Niedermayer <[email protected]>
CommitDate: Fri Nov 21 00:07:39 2025 +0100

    Changelog: update
    
    Signed-off-by: Michael Niedermayer <[email protected]>

diff --git a/Changelog b/Changelog
index 0d216e7782..baf2071723 100644
--- a/Changelog
+++ b/Changelog
@@ -2,6 +2,10 @@ Entries are sorted chronologically from oldest to youngest 
within each release,
 releases are sorted from youngest to oldest.
 
 version 7.1.3:
+ avutil/common: cast GET_BYTE/GET_16BIT returned value
+ avfilter/vf_drawtext: fix call GET_UTF8 with invalid argument
+ avfilter/vf_drawtext: fix incorrect text length
+ avformat/avformat: also clear FFFormatContext packet queue when closing a 
muxer
  avfilter/vf_drawtext: Account for bbox text seperator
  avcodec/mediacodecdec_common: Check that the input to 
mediacodec_wrap_sw_audio_buffer() contains channel * sample_size
  avcodec/utvideodec: Set B for the width= 1 case in restore_median_planar_il()

commit 87e1bea70b4ba3fc54e614298bcc3c415c042c2e
Author:     Zhao Zhili <[email protected]>
AuthorDate: Fri Nov 14 17:23:22 2025 +0800
Commit:     Michael Niedermayer <[email protected]>
CommitDate: Thu Nov 20 17:21:04 2025 +0100

    avutil/common: cast GET_BYTE/GET_16BIT returned value
    
    In case of GET_BYTE/GET_16BIT return signed value.
    
    (cherry picked from commit 0ae8df5f2ceea82337a2456ef16f930faf160189)
    Signed-off-by: Michael Niedermayer <[email protected]>

diff --git a/libavutil/common.h b/libavutil/common.h
index 3b830daf30..bf23aa50b0 100644
--- a/libavutil/common.h
+++ b/libavutil/common.h
@@ -486,13 +486,13 @@ static av_always_inline av_const int av_parity_c(uint32_t 
v)
  * to prevent undefined results.
  */
 #define GET_UTF8(val, GET_BYTE, ERROR)\
-    val= (GET_BYTE);\
+    val= (uint8_t)(GET_BYTE);\
     {\
         uint32_t top = (val & 128) >> 1;\
         if ((val & 0xc0) == 0x80 || val >= 0xFE)\
             {ERROR}\
         while (val & top) {\
-            unsigned int tmp = (GET_BYTE) - 128;\
+            unsigned int tmp = (uint8_t)(GET_BYTE) - 128;\
             if(tmp>>6)\
                 {ERROR}\
             val= (val<<6) + tmp;\
@@ -511,11 +511,11 @@ static av_always_inline av_const int av_parity_c(uint32_t 
v)
  *                  typically a goto statement.
  */
 #define GET_UTF16(val, GET_16BIT, ERROR)\
-    val = (GET_16BIT);\
+    val = (uint16_t)(GET_16BIT);\
     {\
         unsigned int hi = val - 0xD800;\
         if (hi < 0x800) {\
-            val = (GET_16BIT) - 0xDC00;\
+            val = (uint16_t)(GET_16BIT) - 0xDC00;\
             if (val > 0x3FFU || hi > 0x3FFU)\
                 {ERROR}\
             val += (hi<<10) + 0x10000;\

commit 19bc0ef3f3ea33659ad9650e1424686c7931e44d
Author:     Zhao Zhili <[email protected]>
AuthorDate: Fri Nov 14 16:53:07 2025 +0800
Commit:     Michael Niedermayer <[email protected]>
CommitDate: Thu Nov 20 17:21:04 2025 +0100

    avfilter/vf_drawtext: fix call GET_UTF8 with invalid argument
    
    For GET_UTF8(val, GET_BYTE, ERROR), val has type of uint32_t,
    GET_BYTE must return an unsigned integer, otherwise signed
    extension happened due to val= (GET_BYTE), and GET_UTF8 went to
    the error path.
    
    This bug incidentally cancelled the bug where hb_buffer_add_utf8
    was being called with incorrect argument, allowing drawtext to
    function correctly on x86 and macOS ARM, which defined char as
    signed. However, on Linux and Android ARM environments, because
    char is unsigned by default, GET_UTF8 now returns the correct
    return, which unexpectedly revealed issue #20906.
    
    (cherry picked from commit a5cc0e5c9e752f98e38c2a95a0893faeb1f78fa9)
    Signed-off-by: Michael Niedermayer <[email protected]>

diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c
index d8737a2145..dccc534bbc 100644
--- a/libavfilter/vf_drawtext.c
+++ b/libavfilter/vf_drawtext.c
@@ -1394,7 +1394,7 @@ static int measure_text(AVFilterContext *ctx, TextMetrics 
*metrics)
 {
     DrawTextContext *s = ctx->priv;
     char *text = s->expanded_text.str;
-    char *textdup = NULL, *start = NULL;
+    char *textdup = NULL;
     int width64 = 0, w64 = 0;
     int cur_min_y64 = 0, first_max_y64 = -32000;
     int first_min_x64 = 32000, last_max_x64 = -32000;
@@ -1404,7 +1404,7 @@ static int measure_text(AVFilterContext *ctx, TextMetrics 
*metrics)
     Glyph *glyph = NULL;
 
     int i, tab_idx = 0, last_tab_idx = 0, line_offset = 0;
-    char* p;
+    uint8_t *start, *p;
     int ret = 0;
 
     // Count the lines and the tab characters

commit bdc11c44b15be12f8eebef1cb3bfcda240a31d00
Author:     Zhao Zhili <[email protected]>
AuthorDate: Fri Nov 14 16:23:10 2025 +0800
Commit:     Michael Niedermayer <[email protected]>
CommitDate: Thu Nov 20 17:20:49 2025 +0100

    avfilter/vf_drawtext: fix incorrect text length
    
    From the doc of HarfBuzz, what hb_buffer_add_utf8 needs is the
    number of bytes, not Unicode character:
    hb_buffer_add_utf8(buf, text, strlen(text), 0, strlen(text));
    
    Fix issue #20906.
    
    (cherry picked from commit 9bc3c572eaaab559a7258c392528e7a1cad2a9b7)
    Signed-off-by: Michael Niedermayer <[email protected]>

diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c
index 232e4015fb..d8737a2145 100644
--- a/libavfilter/vf_drawtext.c
+++ b/libavfilter/vf_drawtext.c
@@ -1395,7 +1395,6 @@ static int measure_text(AVFilterContext *ctx, TextMetrics 
*metrics)
     DrawTextContext *s = ctx->priv;
     char *text = s->expanded_text.str;
     char *textdup = NULL, *start = NULL;
-    int num_chars = 0;
     int width64 = 0, w64 = 0;
     int cur_min_y64 = 0, first_max_y64 = -32000;
     int first_min_x64 = 32000, last_max_x64 = -32000;
@@ -1458,7 +1457,7 @@ continue_on_failed2:
             TextLine *cur_line = &s->lines[line_count];
             HarfbuzzData *hb = &cur_line->hb_data;
             cur_line->cluster_offset = line_offset;
-            ret = shape_text_hb(s, hb, start, num_chars);
+            ret = shape_text_hb(s, hb, start, p - start);
             if (ret != 0) {
                 goto done;
             }
@@ -1516,14 +1515,12 @@ continue_on_failed2:
             if (w64 > width64) {
                 width64 = w64;
             }
-            num_chars = -1;
             start = p;
             ++line_count;
             line_offset = i + 1;
         }
 
         if (code == 0) break;
-        ++num_chars;
     }
 
     metrics->line_height64 = s->face->size->metrics.height;

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

Summary of changes:
 Changelog                 | 4 ++++
 libavfilter/vf_drawtext.c | 9 +++------
 libavutil/common.h        | 8 ++++----
 3 files changed, 11 insertions(+), 10 deletions(-)


hooks/post-receive
-- 

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

Reply via email to