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

Git pushed a commit to branch master
in repository ffmpeg.

The following commit(s) were added to refs/heads/master by this push:
     new 9559a6036d libavfilter/vf_v360: fix operator precedence in stereo loop 
condition
9559a6036d is described below

commit 9559a6036d8b9e1481c0c8977e5e215ca5c23211
Author:     marcos ashton <[email protected]>
AuthorDate: Mon Mar 23 14:08:35 2026 +0000
Commit:     michaelni <[email protected]>
CommitDate: Wed Mar 25 01:19:08 2026 +0000

    libavfilter/vf_v360: fix operator precedence in stereo loop condition
    
    The loop condition in the DEFINE_REMAP macro:
    
      stereo < 1 + s->out_stereo > STEREO_2D
    
    is parsed by C as:
    
      (stereo < (1 + s->out_stereo)) > STEREO_2D
    
    Since STEREO_2D is 0 and relational operators return 0 or 1, the
    outer comparison against 0 is a no-op for STEREO_2D and STEREO_SBS.
    But for STEREO_TB (value 2) the loop runs 3 iterations instead of 2,
    producing an out-of-bounds stereo pass.
    
    Add parentheses so the comparison is evaluated first:
    
      stereo < 1 + (s->out_stereo > STEREO_2D)
    
    This gives 1 iteration for 2D and 2 for any stereo format (SBS or TB),
    matching the actual number of stereo views.
    
    Signed-off-by: marcos ashton <[email protected]>
---
 libavfilter/vf_v360.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavfilter/vf_v360.c b/libavfilter/vf_v360.c
index a5297c81e9..a08279867f 100644
--- a/libavfilter/vf_v360.c
+++ b/libavfilter/vf_v360.c
@@ -291,7 +291,7 @@ static int remap##ws##_##bits##bit_slice(AVFilterContext 
*ctx, void *arg, int jo
                                                                                
                            \
     av_assert1(s->nb_planes <= AV_VIDEO_MAX_PLANES);                           
                            \
                                                                                
                            \
-    for (int stereo = 0; stereo < 1 + s->out_stereo > STEREO_2D; stereo++) {   
                            \
+    for (int stereo = 0; stereo < 1 + (s->out_stereo > STEREO_2D); stereo++) { 
                              \
         for (int plane = 0; plane < s->nb_planes; plane++) {                   
                            \
             const unsigned map = s->map[plane];                                
                            \
             const int in_linesize  = in->linesize[plane];                      
                            \

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

Reply via email to