]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/fic: Avoid some magic numbers related to cursors
authorMichael Niedermayer <michael@niedermayer.cc>
Sat, 5 May 2018 21:42:36 +0000 (23:42 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Thu, 17 May 2018 00:23:06 +0000 (02:23 +0200)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/fic.c

index d7ee370423c6f960905f3db1067d09cab88b18bf..7f70ee47e663d1dd02c97c987272b6fa00788080 100644 (file)
@@ -82,6 +82,7 @@ static const uint8_t fic_qmat_lq[64] = {
 static const uint8_t fic_header[7] = { 0, 0, 1, 'F', 'I', 'C', 'V' };
 
 #define FIC_HEADER_SIZE 27
+#define CURSOR_OFFSET 59
 
 static av_always_inline void fic_idct(int16_t *blk, int step, int shift, int rnd)
 {
@@ -416,7 +417,7 @@ static int fic_decode_frame(AVCodecContext *avctx, void *data,
 
     /* Draw cursor. */
     if (!skip_cursor) {
-        memcpy(ctx->cursor_buf, src + 59, 32 * 32 * 4);
+        memcpy(ctx->cursor_buf, src + CURSOR_OFFSET, sizeof(ctx->cursor_buf));
         fic_draw_cursor(avctx, cur_x, cur_y);
     }