avformat/mxfdec: Check count in mxf_read_strong_ref_array()
Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 3015c556f3)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
79ad18ddbd
commit
2a549b2e7d
1 changed files with 7 additions and 1 deletions
|
|
@ -875,7 +875,13 @@ static int mxf_read_cryptographic_context(void *arg, AVIOContext *pb, int tag, i
|
|||
|
||||
static int mxf_read_strong_ref_array(AVIOContext *pb, UID **refs, int *count)
|
||||
{
|
||||
*count = avio_rb32(pb);
|
||||
unsigned c = avio_rb32(pb);
|
||||
|
||||
//avio_read() used int
|
||||
if (c > INT_MAX / sizeof(UID))
|
||||
return AVERROR_PATCHWELCOME;
|
||||
*count = c;
|
||||
|
||||
av_free(*refs);
|
||||
*refs = av_calloc(*count, sizeof(UID));
|
||||
if (!*refs) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue