aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMans Rullgard <mans@mansr.com>2012-04-26 14:00:43 +0100
committerReinhard Tartler <siretart@tauware.de>2013-05-09 11:29:05 +0200
commit799000af702ae91c069b330b76355c5c76f70b9b (patch)
tree392a719b0c4e3191c38811af8e888fae83b30268 /libavcodec
parent6d4d186e9e9fcba9f9058691ab00eade028fceff (diff)
downloadffmpeg-799000af702ae91c069b330b76355c5c76f70b9b.tar.gz
dsputil: fix invalid array indexing
Indexing outside an array is invalid and causes errors with gcc 4.8. Signed-off-by: Mans Rullgard <mans@mansr.com> (cherry picked from commit 0a07f2b346433a9a2677c69c6b29a1a827e39109) Signed-off-by: Diego Biurrun <diego@biurrun.de>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/dsputil.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/libavcodec/dsputil.c b/libavcodec/dsputil.c
index 4389289d82..d054583155 100644
--- a/libavcodec/dsputil.c
+++ b/libavcodec/dsputil.c
@@ -2848,7 +2848,7 @@ int ff_check_alignment(void){
av_cold void dsputil_init(DSPContext* c, AVCodecContext *avctx)
{
- int i;
+ int i, j;
ff_check_alignment();
@@ -3238,11 +3238,15 @@ av_cold void dsputil_init(DSPContext* c, AVCodecContext *avctx)
if (ARCH_SH4) dsputil_init_sh4 (c, avctx);
if (ARCH_BFIN) dsputil_init_bfin (c, avctx);
- for(i=0; i<64; i++){
- if(!c->put_2tap_qpel_pixels_tab[0][i])
- c->put_2tap_qpel_pixels_tab[0][i]= c->put_h264_qpel_pixels_tab[0][i];
- if(!c->avg_2tap_qpel_pixels_tab[0][i])
- c->avg_2tap_qpel_pixels_tab[0][i]= c->avg_h264_qpel_pixels_tab[0][i];
+ for (i = 0; i < 4; i++) {
+ for (j = 0; j < 16; j++) {
+ if(!c->put_2tap_qpel_pixels_tab[i][j])
+ c->put_2tap_qpel_pixels_tab[i][j] =
+ c->put_h264_qpel_pixels_tab[i][j];
+ if(!c->avg_2tap_qpel_pixels_tab[i][j])
+ c->avg_2tap_qpel_pixels_tab[i][j] =
+ c->avg_h264_qpel_pixels_tab[i][j];
+ }
}
c->put_rv30_tpel_pixels_tab[0][0] = c->put_h264_qpel_pixels_tab[0][0];