Commit fd4c1c0b authored by Michael Niedermayer's avatar Michael Niedermayer

truemotion1: Check index, fix out of array read

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 96fe99cb
......@@ -512,6 +512,10 @@ hres,vres,i,i%vres (0 < i < 4)
}
#define APPLY_C_PREDICTOR() \
if(index > 1023){\
av_log(s->avctx, AV_LOG_ERROR, " index %d went out of bounds\n", index); \
return; \
}\
predictor_pair = s->c_predictor_table[index]; \
horiz_pred += (predictor_pair >> 1); \
if (predictor_pair & 1) { \
......@@ -529,6 +533,10 @@ hres,vres,i,i%vres (0 < i < 4)
index++;
#define APPLY_C_PREDICTOR_24() \
if(index > 1023){\
av_log(s->avctx, AV_LOG_ERROR, " index %d went out of bounds\n", index); \
return; \
}\
predictor_pair = s->c_predictor_table[index]; \
horiz_pred += (predictor_pair >> 1); \
if (predictor_pair & 1) { \
......@@ -547,6 +555,10 @@ hres,vres,i,i%vres (0 < i < 4)
#define APPLY_Y_PREDICTOR() \
if(index > 1023){\
av_log(s->avctx, AV_LOG_ERROR, " index %d went out of bounds\n", index); \
return; \
}\
predictor_pair = s->y_predictor_table[index]; \
horiz_pred += (predictor_pair >> 1); \
if (predictor_pair & 1) { \
......@@ -564,6 +576,10 @@ hres,vres,i,i%vres (0 < i < 4)
index++;
#define APPLY_Y_PREDICTOR_24() \
if(index > 1023){\
av_log(s->avctx, AV_LOG_ERROR, " index %d went out of bounds\n", index); \
return; \
}\
predictor_pair = s->y_predictor_table[index]; \
horiz_pred += (predictor_pair >> 1); \
if (predictor_pair & 1) { \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment