ffmpeg | branch: master | Frank Plowman <p...@frankplowman.com> | Sat May 17 
21:52:48 2025 +0100| [670089304ac856f01591c88bbb7c115d423935da] | committer: 
Nuo Mi

lavc/vvc: Avoid UB in DB strength derivation for PLT CUs

When called for palette-predicted CUs, boundary_strength could cause
undefined behaviour due to accessing uninitialised motion information.
The spec doesn't include this, but in the reference software it seems
the deblock strength is always set to 0 for palette CUs due to some
implementation details: perhaps this is a spec issue?

Signed-off-by: Frank Plowman <p...@frankplowman.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=670089304ac856f01591c88bbb7c115d423935da
---

 libavcodec/vvc/filter.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/vvc/filter.c b/libavcodec/vvc/filter.c
index e3886d008e..3815668bcf 100644
--- a/libavcodec/vvc/filter.c
+++ b/libavcodec/vvc/filter.c
@@ -385,6 +385,9 @@ static int boundary_strength(const VVCLocalContext *lc, 
const MvField *curr, con
 {
     RefPicList *rpl = lc->sc->rpl;
 
+    if (curr->pred_flag == PF_PLT)
+        return 0;
+
     if (curr->pred_flag == PF_IBC)
         return FFABS(neigh->mv[0].x - curr->mv[0].x) >= 8 || 
FFABS(neigh->mv[0].y - curr->mv[0].y) >= 8;
 

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to