diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2016-01-05 14:41:04 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2016-01-05 18:10:34 +0100 |
commit | 5b4da8a38a5ed211df9504c85ce401c30af86b97 (patch) | |
tree | 8709a7ac58039ac905041ab8f2dd5215cc5781e1 /libavcodec/mpeg12enc.c | |
parent | e7271e6d078a4f8064cf6eef59eff7d58da1b1d5 (diff) | |
download | ffmpeg-5b4da8a38a5ed211df9504c85ce401c30af86b97.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>
Diffstat (limited to 'libavcodec/mpeg12enc.c')
-rw-r--r-- | libavcodec/mpeg12enc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/mpeg12enc.c b/libavcodec/mpeg12enc.c index e4b96bec1d..349136ef9e 100644 --- a/libavcodec/mpeg12enc.c +++ b/libavcodec/mpeg12enc.c @@ -47,7 +47,7 @@ static const uint8_t svcd_scan_offset_placeholder[] = { 0x81, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, }; -static uint8_t mv_penalty[MAX_FCODE + 1][MAX_MV * 2 + 1]; +static uint8_t mv_penalty[MAX_FCODE + 1][MAX_DMV * 2 + 1]; static uint8_t fcode_tab[MAX_MV * 2 + 1]; static uint8_t uni_mpeg1_ac_vlc_len[64 * 64 * 2]; @@ -1041,7 +1041,7 @@ av_cold void ff_mpeg1_encode_init(MpegEncContext *s) } 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) { @@ -1064,7 +1064,7 @@ av_cold void ff_mpeg1_encode_init(MpegEncContext *s) 2 + bit_size; } - mv_penalty[f_code][mv + MAX_MV] = len; + mv_penalty[f_code][mv + MAX_DMV] = len; } |