summaryrefslogtreecommitdiff
path: root/libavcodec/ituh263enc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2016-01-05 14:41:04 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2016-01-05 18:10:34 +0100
commit5b4da8a38a5ed211df9504c85ce401c30af86b97 (patch)
tree8709a7ac58039ac905041ab8f2dd5215cc5781e1 /libavcodec/ituh263enc.c
parente7271e6d078a4f8064cf6eef59eff7d58da1b1d5 (diff)
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>
Diffstat (limited to 'libavcodec/ituh263enc.c')
-rw-r--r--libavcodec/ituh263enc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/ituh263enc.c b/libavcodec/ituh263enc.c
index 03f4011bfa..d9596c9f3b 100644
--- a/libavcodec/ituh263enc.c
+++ b/libavcodec/ituh263enc.c
@@ -45,7 +45,7 @@
/**
* Table of number of bits a motion vector component needs.
*/
-static uint8_t mv_penalty[MAX_FCODE+1][MAX_MV*2+1];
+static uint8_t mv_penalty[MAX_FCODE+1][MAX_DMV*2+1];
/**
* Minimal fcode that a motion vector component would need.
@@ -678,7 +678,7 @@ static av_cold void init_mv_penalty_and_fcode(MpegEncContext *s)
int mv;
for(f_code=1; f_code<=MAX_FCODE; f_code++){
- for(mv=-MAX_MV; mv<=MAX_MV; mv++){
+ for(mv=-MAX_DMV; mv<=MAX_DMV; mv++){
int len;
if(mv==0) len= ff_mvtab[0][1];
@@ -699,7 +699,7 @@ static av_cold void init_mv_penalty_and_fcode(MpegEncContext *s)
}
}
- mv_penalty[f_code][mv+MAX_MV]= len;
+ mv_penalty[f_code][mv+MAX_DMV]= len;
}
}