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

Git pushed a commit to branch master
in repository ffmpeg.

commit b98751b13c7295765ba212ecb0c23a213c6d3a2d
Author:     Niklas Haas <[email protected]>
AuthorDate: Tue Feb 10 18:18:09 2026 +0100
Commit:     Niklas Haas <[email protected]>
CommitDate: Mon Feb 23 19:39:17 2026 +0000

    swscale/graph: set up palette using current input image
    
    Using the original input image here is completely wrong - the format/palette
    could have been set to anything else in the meantime. At best, we would 
want to
    use the original input to add_legacy_sws_pass(), but it's impossible for 
this
    to differ from the per-pass input. The only time legacy subpasses are added
    is when using cascaded contexts, but in this case, the only context actually
    reading from the palette format would be the first one.
    
    I'm not entirely sure why this code was originally written this way, but
    I'm reasonably confident that it's not at all necessary. Tested extensively
    on both FATE, the self-test, and real-world files.
    
    Signed-off-by: Niklas Haas <[email protected]>
---
 libswscale/graph.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/libswscale/graph.c b/libswscale/graph.c
index 985406fc80..2d07c4bb06 100644
--- a/libswscale/graph.c
+++ b/libswscale/graph.c
@@ -219,8 +219,6 @@ static void free_legacy_swscale(void *priv)
 static void setup_legacy_swscale(const SwsImg *out, const SwsImg *in,
                                  const SwsPass *pass)
 {
-    const SwsGraph *graph = pass->graph;
-    const SwsImg *in_orig = graph->exec.input;
     SwsContext *sws = pass->priv;
     SwsInternal *c = sws_internal(sws);
     if (sws->flags & SWS_BITEXACT && sws->dither == SWS_DITHER_ED && 
c->dither_error[0]) {
@@ -229,7 +227,7 @@ static void setup_legacy_swscale(const SwsImg *out, const 
SwsImg *in,
     }
 
     if (usePal(sws->src_format))
-        ff_update_palette(c, (const uint32_t *) in_orig->data[1]);
+        ff_update_palette(c, (const uint32_t *) in->data[1]);
 }
 
 static inline SwsContext *slice_ctx(const SwsPass *pass, int y)

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

Reply via email to