[SCM] libav/upstream.snapshot: kmvc: Clip pixel position to valid range

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sat Jul 13 06:29:08 UTC 2013


The following commit has been merged in the upstream.snapshot branch:
commit 258eea3f2e0db2c8d46982b766b7965c40095a28
Author: Luca Barbato <lu_zero at gentoo.org>
Date:   Mon Jul 1 03:05:41 2013 +0200

    kmvc: Clip pixel position to valid range
    
    Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
    CC: libav-stable at libav.org
    (cherry picked from commit 4e7f0b082d8c4b360312216b9241bec65ff63b35)
    
    Signed-off-by: Reinhard Tartler <siretart at tauware.de>

diff --git a/libavcodec/kmvc.c b/libavcodec/kmvc.c
index 1bfc0da..e3dcd07 100644
--- a/libavcodec/kmvc.c
+++ b/libavcodec/kmvc.c
@@ -30,6 +30,7 @@
 #include "avcodec.h"
 #include "bytestream.h"
 #include "internal.h"
+#include "libavutil/common.h"
 
 #define KMVC_KEYFRAME 0x80
 #define KMVC_PALETTE  0x40
@@ -56,7 +57,7 @@ typedef struct BitBuf {
     int 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);
 

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list