Merge commit '798c715f4fa5cde37456af6202a32ee62cfb96d9' into release/1.1
* commit '798c715f4fa5cde37456af6202a32ee62cfb96d9': configure: enable PIC on s390(x) ituh263: reject b-frame with pp_time = 0 lagarith: reallocate rgb_planes when needed truemotion1: check the header size shorten: pad the internal bitstream buffer samplefmt: avoid integer overflow in av_samples_get_buffer_size() Conflicts: libavcodec/lagarith.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
4
configure
vendored
4
configure
vendored
@@ -3108,6 +3108,10 @@ case "$arch" in
|
||||
check_64bit ppc ppc64 'sizeof(void *) > 4'
|
||||
spic=$shared
|
||||
;;
|
||||
s390)
|
||||
check_64bit s390 s390x 'sizeof(void *) > 4'
|
||||
spic=$shared
|
||||
;;
|
||||
sparc)
|
||||
check_64bit sparc sparc64 'sizeof(void *) > 4'
|
||||
spic=$shared
|
||||
|
@@ -757,6 +757,8 @@ int ff_h263_decode_mb(MpegEncContext *s,
|
||||
}
|
||||
|
||||
if(IS_DIRECT(mb_type)){
|
||||
if (!s->pp_time)
|
||||
return AVERROR_INVALIDDATA;
|
||||
s->mv_dir = MV_DIR_FORWARD | MV_DIR_BACKWARD | MV_DIRECT;
|
||||
mb_type |= ff_mpeg4_set_direct_mv(s, 0, 0);
|
||||
}else{
|
||||
|
@@ -53,6 +53,7 @@ typedef struct LagarithContext {
|
||||
int zeros; /**< number of consecutive zero bytes encountered */
|
||||
int zeros_rem; /**< number of zero bytes remaining to output */
|
||||
uint8_t *rgb_planes;
|
||||
int rgb_planes_allocated;
|
||||
int rgb_stride;
|
||||
} LagarithContext;
|
||||
|
||||
@@ -567,14 +568,13 @@ static int lag_decode_frame(AVCodecContext *avctx,
|
||||
offs[1] = offset_gu;
|
||||
offs[2] = offset_ry;
|
||||
|
||||
if (!l->rgb_planes) {
|
||||
l->rgb_stride = FFALIGN(avctx->width, 16);
|
||||
l->rgb_planes = av_malloc(l->rgb_stride * avctx->height * 4 + 16);
|
||||
av_fast_malloc(&l->rgb_planes, &l->rgb_planes_allocated,
|
||||
l->rgb_stride * avctx->height * planes + 1);
|
||||
if (!l->rgb_planes) {
|
||||
av_log(avctx, AV_LOG_ERROR, "cannot allocate temporary buffer\n");
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
}
|
||||
for (i = 0; i < planes; i++)
|
||||
srcs[i] = l->rgb_planes + (i + 1) * l->rgb_stride * avctx->height - l->rgb_stride;
|
||||
for (i = 0; i < planes; i++)
|
||||
|
@@ -437,7 +437,7 @@ static int shorten_decode_frame(AVCodecContext *avctx, void *data,
|
||||
void *tmp_ptr;
|
||||
s->max_framesize = 8192; // should hopefully be enough for the first header
|
||||
tmp_ptr = av_fast_realloc(s->bitstream, &s->allocated_bitstream_size,
|
||||
s->max_framesize);
|
||||
s->max_framesize + FF_INPUT_BUFFER_PADDING_SIZE);
|
||||
if (!tmp_ptr) {
|
||||
av_log(avctx, AV_LOG_ERROR, "error allocating bitstream buffer\n");
|
||||
return AVERROR(ENOMEM);
|
||||
|
@@ -322,6 +322,11 @@ static int truemotion1_decode_header(TrueMotion1Context *s)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (header.header_size + 1 > s->size) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "Input packet too small.\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
/* unscramble the header bytes with a XOR operation */
|
||||
for (i = 1; i < header.header_size; i++)
|
||||
header_buffer[i - 1] = s->buf[i] ^ s->buf[i + 1];
|
||||
|
@@ -135,6 +135,8 @@ int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples,
|
||||
|
||||
/* auto-select alignment if not specified */
|
||||
if (!align) {
|
||||
if (nb_samples > INT_MAX - 31)
|
||||
return AVERROR(EINVAL);
|
||||
align = 1;
|
||||
nb_samples = FFALIGN(nb_samples, 32);
|
||||
}
|
||||
|
Reference in New Issue
Block a user