]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/agm.c
avcodec: Constify AVCodecs
[ffmpeg] / libavcodec / agm.c
index 19490c54564b2ebf822dd466b1338d2374ae5f53..7579d9765d10c41ea954bbdf71ebe3b20ca26de5 100644 (file)
@@ -26,6 +26,8 @@
 
 #define BITSTREAM_READER_LE
 
+#include "libavutil/mem_internal.h"
+
 #include "avcodec.h"
 #include "bytestream.h"
 #include "copy_block.h"
@@ -423,8 +425,8 @@ static int decode_inter_plane(AGMContext *s, GetBitContext *gb, int size,
                 int map = s->map[x];
 
                 if (orig_mv_x >= -32) {
-                    if (y * 8 + mv_y < 0 || y * 8 + mv_y + 8 >= h ||
-                        x * 8 + mv_x < 0 || x * 8 + mv_x + 8 >= w)
+                    if (y * 8 + mv_y < 0 || y * 8 + mv_y + 8 > h ||
+                        x * 8 + mv_x < 0 || x * 8 + mv_x + 8 > w)
                         return AVERROR_INVALIDDATA;
 
                     copy_block8(frame->data[plane] + (s->blocks_h - 1 - y) * 8 * frame->linesize[plane] + x * 8,
@@ -1283,7 +1285,7 @@ static av_cold int decode_close(AVCodecContext *avctx)
     return 0;
 }
 
-AVCodec ff_agm_decoder = {
+const AVCodec ff_agm_decoder = {
     .name             = "agm",
     .long_name        = NULL_IF_CONFIG_SMALL("Amuse Graphics Movie"),
     .type             = AVMEDIA_TYPE_VIDEO,