Commit 80ddf788 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge remote-tracking branch 'qatar/release/9' into release/1.1

* qatar/release/9:
  doc: Fix some obsolete references to av* tools as ff* tools
  vqavideo: check chunk sizes before reading chunks
  roqvideodec: check dimensions validity
  qdm2: check array index before use, fix out of array accesses
  mpegvideo: Do REBASE_PICTURE with byte pointers

Conflicts:
	libavcodec/qdm2.c
	libavcodec/roqvideodec.c
	libavcodec/vqavideo.c
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 4be63111 6626a7df
......@@ -731,7 +731,7 @@ typedef struct MpegEncContext {
#define REBASE_PICTURE(pic, new_ctx, old_ctx) (pic ? \
(pic >= old_ctx->picture && pic < old_ctx->picture+old_ctx->picture_count ?\
&new_ctx->picture[pic - old_ctx->picture] : pic - (Picture*)old_ctx + (Picture*)new_ctx)\
&new_ctx->picture[pic - old_ctx->picture] : (Picture*) ((uint8_t*)pic - (uint8_t*)old_ctx + (uint8_t*)new_ctx))\
: NULL)
/* mpegvideo_enc common options */
......
......@@ -1258,7 +1258,7 @@ static void qdm2_decode_super_block (QDM2Context *q)
for (i = 0; packet_bytes > 0; i++) {
int j;
if (i>=FF_ARRAY_ELEMS(q->sub_packet_list_A)) {
if (i >= FF_ARRAY_ELEMS(q->sub_packet_list_A)) {
SAMPLES_NEEDED_2("too many packet bytes");
return;
}
......
......@@ -171,9 +171,10 @@ static av_cold int roq_decode_init(AVCodecContext *avctx)
s->avctx = avctx;
if (avctx->width%16 || avctx->height%16) {
av_log_ask_for_sample(avctx, "dimensions not being a multiple of 16 are unsupported\n");
return AVERROR_PATCHWELCOME;
if (avctx->width % 16 || avctx->height % 16) {
av_log(avctx, AV_LOG_ERROR,
"Dimensions must be a multiple of 16\n");
return AVERROR_PATCHWELCOME;
}
s->width = avctx->width;
......
......@@ -538,7 +538,8 @@ static int vqa_decode_chunk(VqaContext *s)
chunk_size = bytestream2_get_be32(&s->gb);
if (chunk_size > MAX_CODEBOOK_SIZE - s->next_codebook_buffer_index) {
av_log(s->avctx, AV_LOG_ERROR, "cbp0 chunk too large (0x%X bytes)\n", chunk_size);
av_log(s->avctx, AV_LOG_ERROR, "cbp0 chunk too large (%u bytes)\n",
chunk_size);
return AVERROR_INVALIDDATA;
}
......@@ -566,7 +567,8 @@ static int vqa_decode_chunk(VqaContext *s)
chunk_size = bytestream2_get_be32(&s->gb);
if (chunk_size > MAX_CODEBOOK_SIZE - s->next_codebook_buffer_index) {
av_log(s->avctx, AV_LOG_ERROR, "cbpz chunk too large (0x%X bytes)\n", chunk_size);
av_log(s->avctx, AV_LOG_ERROR, "cbpz chunk too large (%u bytes)\n",
chunk_size);
return AVERROR_INVALIDDATA;
}
......
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