Merge commit '7b337b122959b9bf634c31b549892df974f35b40' into release/1.1

* commit '7b337b122959b9bf634c31b549892df974f35b40':
  truemotion1: make sure index does not go out of bounds
  pcx: round up in bits->bytes conversion in a buffer size check
  omadec: Fix wrong number of array elements
  omadec: check GEOB sizes against buffer size
  ac3dec: fix outptr increment.
  avio: Use AVERROR_PROTOCOL_NOT_FOUND

Conflicts:
	libavcodec/ac3dec.c
	libavcodec/pcx.c
	libavformat/omadec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer
2014-01-12 16:16:58 +01:00
2 changed files with 19 additions and 11 deletions

View File

@@ -513,6 +513,15 @@ hres,vres,i,i%vres (0 < i < 4)
index = s->index_stream[index_stream_index++] * 4; \
}
#define INC_INDEX \
do { \
if (index >= 1023) { \
av_log(s->avctx, AV_LOG_ERROR, "Invalid index value.\n"); \
return; \
} \
index++; \
} while (0)
#define APPLY_C_PREDICTOR() \
if(index > 1023){\
av_log(s->avctx, AV_LOG_ERROR, " index %d went out of bounds\n", index); \
@@ -529,10 +538,10 @@ hres,vres,i,i%vres (0 < i < 4)
if (predictor_pair & 1) \
GET_NEXT_INDEX() \
else \
index++; \
INC_INDEX; \
} \
} else \
index++;
INC_INDEX;
#define APPLY_C_PREDICTOR_24() \
if(index > 1023){\
@@ -550,10 +559,10 @@ hres,vres,i,i%vres (0 < i < 4)
if (predictor_pair & 1) \
GET_NEXT_INDEX() \
else \
index++; \
INC_INDEX; \
} \
} else \
index++;
INC_INDEX;
#define APPLY_Y_PREDICTOR() \
@@ -572,10 +581,10 @@ hres,vres,i,i%vres (0 < i < 4)
if (predictor_pair & 1) \
GET_NEXT_INDEX() \
else \
index++; \
INC_INDEX; \
} \
} else \
index++;
INC_INDEX;
#define APPLY_Y_PREDICTOR_24() \
if(index > 1023){\
@@ -593,10 +602,10 @@ hres,vres,i,i%vres (0 < i < 4)
if (predictor_pair & 1) \
GET_NEXT_INDEX() \
else \
index++; \
INC_INDEX; \
} \
} else \
index++;
INC_INDEX;
#define OUTPUT_PIXEL_PAIR() \
*current_pixel_pair = *vert_pred + horiz_pred; \

View File

@@ -233,9 +233,8 @@ static int decrypt_init(AVFormatContext *s, ID3v2ExtraMeta *em, uint8_t *header)
av_log(s, AV_LOG_ERROR, "Invalid encryption header\n");
return -1;
}
if ( OMA_ENC_HEADER_SIZE + oc->k_size + oc->e_size + oc->i_size + 8 > geob->datasize
|| OMA_ENC_HEADER_SIZE + 48 > geob->datasize
) {
if (OMA_ENC_HEADER_SIZE + oc->k_size + oc->e_size + oc->i_size + 8 > geob->datasize ||
OMA_ENC_HEADER_SIZE + 48 > geob->datasize) {
av_log(s, AV_LOG_ERROR, "Too little GEOB data\n");
return AVERROR_INVALIDDATA;
}