aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/mpegvideo.h
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2016-01-05 14:41:04 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2016-01-31 00:25:20 +0100
commit593dea80f28e2be96d149f11118f8591c421b68c (patch)
tree4dc21b96718792a893f557d40572c94c3378d7e0 /libavcodec/mpegvideo.h
parent8158fb129e159d594d85ed8ef58ac609088e19cd (diff)
downloadffmpeg-593dea80f28e2be96d149f11118f8591c421b68c.tar.gz
avcodec/motion_est: Fix mv_penalty table size
Fixes out of array read Found-by: Tyson Smith <twsmith@mozilla.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 5b4da8a38a5ed211df9504c85ce401c30af86b97) Conflicts: libavcodec/motion_est.h
Diffstat (limited to 'libavcodec/mpegvideo.h')
-rw-r--r--libavcodec/mpegvideo.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/mpegvideo.h b/libavcodec/mpegvideo.h
index 63ce8e77c7..6c3757cb94 100644
--- a/libavcodec/mpegvideo.h
+++ b/libavcodec/mpegvideo.h
@@ -64,6 +64,7 @@ enum OutputFormat {
#define MAX_FCODE 7
#define MAX_MV 4096
+#define MAX_DMV (2*MAX_MV)
#define MAX_THREADS 32
#define MAX_PICTURE_COUNT 36
@@ -196,7 +197,7 @@ typedef struct MotionEstContext{
op_pixels_func (*hpel_avg)[4];
qpel_mc_func (*qpel_put)[16];
qpel_mc_func (*qpel_avg)[16];
- uint8_t (*mv_penalty)[MAX_MV*2+1]; ///< amount of bits needed to encode a MV
+ uint8_t (*mv_penalty)[MAX_DMV*2+1]; ///< amount of bits needed to encode a MV
uint8_t *current_mv_penalty;
int (*sub_motion_search)(struct MpegEncContext * s,
int *mx_ptr, int *my_ptr, int dmin,