mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
Merge commit '488f87be873506abb01d67708a67c10a4dd29283'
* commit '488f87be873506abb01d67708a67c10a4dd29283': roqvideodec: check dimensions validity vqavideo: check chunk sizes before reading chunks qdm2: check array index before use, fix out of array accesses Conflicts: libavcodec/qdm2.c libavcodec/roqvideodec.c libavcodec/vqavideo.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
96008082db
@ -1257,7 +1257,7 @@ static void qdm2_decode_super_block (QDM2Context *q)
|
|||||||
for (i = 0; packet_bytes > 0; i++) {
|
for (i = 0; packet_bytes > 0; i++) {
|
||||||
int j;
|
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");
|
SAMPLES_NEEDED_2("too many packet bytes");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -171,9 +171,10 @@ static av_cold int roq_decode_init(AVCodecContext *avctx)
|
|||||||
|
|
||||||
s->avctx = avctx;
|
s->avctx = avctx;
|
||||||
|
|
||||||
if (avctx->width%16 || avctx->height%16) {
|
if (avctx->width % 16 || avctx->height % 16) {
|
||||||
av_log_ask_for_sample(avctx, "dimensions not being a multiple of 16 are unsupported\n");
|
av_log(avctx, AV_LOG_ERROR,
|
||||||
return AVERROR_PATCHWELCOME;
|
"Dimensions must be a multiple of 16\n");
|
||||||
|
return AVERROR_PATCHWELCOME;
|
||||||
}
|
}
|
||||||
|
|
||||||
s->width = avctx->width;
|
s->width = avctx->width;
|
||||||
|
@ -538,7 +538,8 @@ static int vqa_decode_chunk(VqaContext *s)
|
|||||||
chunk_size = bytestream2_get_be32(&s->gb);
|
chunk_size = bytestream2_get_be32(&s->gb);
|
||||||
|
|
||||||
if (chunk_size > MAX_CODEBOOK_SIZE - s->next_codebook_buffer_index) {
|
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;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -566,7 +567,8 @@ static int vqa_decode_chunk(VqaContext *s)
|
|||||||
chunk_size = bytestream2_get_be32(&s->gb);
|
chunk_size = bytestream2_get_be32(&s->gb);
|
||||||
|
|
||||||
if (chunk_size > MAX_CODEBOOK_SIZE - s->next_codebook_buffer_index) {
|
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;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user