You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
avformat/mxfdec: do not allow more partitions than INT_MAX/2
Some math (e.g: partition binary search) overflows if we have that many parititions. Signed-off-by: Marton Balint <cus@passwd.hu>
This commit is contained in:
@@ -565,6 +565,9 @@ static int mxf_read_partition_pack(void *arg, AVIOContext *pb, int tag, int size
|
|||||||
uint64_t footer_partition;
|
uint64_t footer_partition;
|
||||||
uint32_t nb_essence_containers;
|
uint32_t nb_essence_containers;
|
||||||
|
|
||||||
|
if (mxf->partitions_count >= INT_MAX / 2)
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
|
||||||
tmp_part = av_realloc_array(mxf->partitions, mxf->partitions_count + 1, sizeof(*mxf->partitions));
|
tmp_part = av_realloc_array(mxf->partitions, mxf->partitions_count + 1, sizeof(*mxf->partitions));
|
||||||
if (!tmp_part)
|
if (!tmp_part)
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
|
Reference in New Issue
Block a user