You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
avcodec/hcom: check that index into array is valid
This commit is contained in:
@@ -63,6 +63,10 @@ static av_cold int hcom_init(AVCodecContext *avctx)
|
|||||||
for (int i = 0; i < s->dict_entries; i++) {
|
for (int i = 0; i < s->dict_entries; i++) {
|
||||||
s->dict[i].l = AV_RB16(avctx->extradata + 6 + 4 * i);
|
s->dict[i].l = AV_RB16(avctx->extradata + 6 + 4 * i);
|
||||||
s->dict[i].r = AV_RB16(avctx->extradata + 6 + 4 * i + 2);
|
s->dict[i].r = AV_RB16(avctx->extradata + 6 + 4 * i + 2);
|
||||||
|
if (s->dict[i].l >= 0 &&
|
||||||
|
(s->dict[i].l >= s->dict_entries ||
|
||||||
|
s->dict[i].r >= s->dict_entries))
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
|
|
||||||
avctx->sample_fmt = AV_SAMPLE_FMT_U8;
|
avctx->sample_fmt = AV_SAMPLE_FMT_U8;
|
||||||
|
Reference in New Issue
Block a user