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

Git pushed a commit to branch master
in repository ffmpeg.

commit b58d3afe5e165198600aed8688d3b14cca82ecc4
Author:     Michael Niedermayer <[email protected]>
AuthorDate: Mon Sep 28 17:28:30 2026 +0200
Commit:     michaelni <[email protected]>
CommitDate: Sun Oct 11 00:45:42 2026 +0000

    avfilter/vf_libopencv: count a last line without terminating newline
    
    Fixes: last row of the shape file dropped
    Found during review of the read_shape_from_file() fixes
---
 libavfilter/vf_libopencv.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/libavfilter/vf_libopencv.c b/libavfilter/vf_libopencv.c
index ecc0edde9e..7888d8f18c 100644
--- a/libavfilter/vf_libopencv.c
+++ b/libavfilter/vf_libopencv.c
@@ -139,10 +139,11 @@ static int read_shape_from_file(int *cols, int *rows, int 
**values, const char *
     /* the file alone defines the size of the shape */
     *cols = *rows = 0;
 
-    /* prescan file to get the number of lines and the maximum width */
+    /* prescan file to get the number of lines and the maximum width,
+     * the last line need not be newline terminated */
     w = 0;
-    for (i = 0; i < size; i++) {
-        if (buf[i] == '\n') {
+    for (i = 0; i < size || w; i++) {
+        if (i == size || buf[i] == '\n') {
             if (*rows == INT_MAX) {
                 av_log(log_ctx, AV_LOG_ERROR, "Overflow on the number of rows 
in the file\n");
                 ret = AVERROR_INVALIDDATA;

-- 
To stop receiving notification emails like this one, please contact
[email protected].
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to