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

Git pushed a commit to branch master
in repository ffmpeg.

commit 1fd3199ae011744849dafede0fbddea45972fe28
Author:     Michael Niedermayer <[email protected]>
AuthorDate: Tue Oct 13 05:35:56 2026 +0200
Commit:     michaelni <[email protected]>
CommitDate: Tue Oct 20 20:41:50 2026 +0000

    avcodec/tdsc: store the cursor hotspot only after the cursor header is 
accepted
    
    A rejected cursor header moved the retained cursor sprite to its
    hotspot.
    
    Fixes: 18O8mbD0uiX8
    Fixes: wrong cursor position
    Wrong cursor position Replicated through UnModified FFmpeg with output diff
    Found during the review of https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24682
---
 libavcodec/tdsc.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/libavcodec/tdsc.c b/libavcodec/tdsc.c
index 9f66ba9e18..e374906ae7 100644
--- a/libavcodec/tdsc.c
+++ b/libavcodec/tdsc.c
@@ -200,11 +200,11 @@ static void tdsc_paint_cursor(AVCodecContext *avctx, 
uint8_t *dst, int stride)
 static int tdsc_load_cursor(AVCodecContext *avctx)
 {
     TDSCContext *ctx  = avctx->priv_data;
-    int i, j, k, ret, cursor_fmt, w, h;
+    int i, j, k, ret, cursor_fmt, w, h, hot_x, hot_y;
     uint8_t *dst;
 
-    ctx->cursor_hot_x = bytestream2_get_le16(&ctx->gbc);
-    ctx->cursor_hot_y = bytestream2_get_le16(&ctx->gbc);
+    hot_x             = bytestream2_get_le16(&ctx->gbc);
+    hot_y             = bytestream2_get_le16(&ctx->gbc);
     w                 = bytestream2_get_le16(&ctx->gbc);
     h                 = bytestream2_get_le16(&ctx->gbc);
 
@@ -222,6 +222,8 @@ static int tdsc_load_cursor(AVCodecContext *avctx)
     ctx->cursor_w      = w;
     ctx->cursor_h      = h;
     ctx->cursor_stride = FFALIGN(w, 32) * 4;
+    ctx->cursor_hot_x  = hot_x;
+    ctx->cursor_hot_y  = hot_y;
     if (ctx->cursor_hot_x > ctx->cursor_w ||
         ctx->cursor_hot_y > ctx->cursor_h) {
         av_log(avctx, AV_LOG_WARNING, "Invalid hotspot position %d.%d.\n",

-- 
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