[FFmpeg-cvslog] avcodec/fic: Avoid some magic numbers related to cursors

Michael Niedermayer git at videolan.org
Sat Jun 16 01:31:52 EEST 2018


ffmpeg | branch: release/4.0 | Michael Niedermayer <michael at niedermayer.cc> | Sat May  5 23:42:36 2018 +0200| [2742cb10c7337683967f494ba8090d87eb0af7d7] | committer: Michael Niedermayer

avcodec/fic: Avoid some magic numbers related to cursors

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit c6a11714c4b1227be62cbc36651ccfc415e8e623)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavcodec/fic.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/fic.c b/libavcodec/fic.c
index 526af63f6c..c288c9771b 100644
--- a/libavcodec/fic.c
+++ b/libavcodec/fic.c
@@ -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)
 {
@@ -420,7 +421,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);
     }
 



More information about the ffmpeg-cvslog mailing list