Commit 4e7f0b08 authored by Luca Barbato's avatar Luca Barbato

kmvc: Clip pixel position to valid range

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
parent 8f689770
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include "avcodec.h" #include "avcodec.h"
#include "bytestream.h" #include "bytestream.h"
#include "internal.h" #include "internal.h"
#include "libavutil/common.h"
#define KMVC_KEYFRAME 0x80 #define KMVC_KEYFRAME 0x80
#define KMVC_PALETTE 0x40 #define KMVC_PALETTE 0x40
...@@ -55,7 +56,7 @@ typedef struct BitBuf { ...@@ -55,7 +56,7 @@ typedef struct BitBuf {
int bitbuf; int bitbuf;
} BitBuf; } BitBuf;
#define BLK(data, x, y) data[(x) + (y) * 320] #define BLK(data, x, y) data[av_clip((x) + (y) * 320, 0, 320 * 200 -1)]
#define kmvc_init_getbits(bb, g) bb.bits = 7; bb.bitbuf = bytestream2_get_byte(g); #define kmvc_init_getbits(bb, g) bb.bits = 7; bb.bitbuf = bytestream2_get_byte(g);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment