movdec: Avoid av_malloc(0) in stss
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
(cherry picked from commit 29a20ac4a1
)
This commit is contained in:
@@ -1503,6 +1503,8 @@ static int mov_read_stss(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
|||||||
|
|
||||||
av_dlog(c->fc, "keyframe_count = %d\n", entries);
|
av_dlog(c->fc, "keyframe_count = %d\n", entries);
|
||||||
|
|
||||||
|
if (!entries)
|
||||||
|
return 0;
|
||||||
if (entries >= UINT_MAX / sizeof(int))
|
if (entries >= UINT_MAX / sizeof(int))
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
sc->keyframes = av_malloc(entries * sizeof(int));
|
sc->keyframes = av_malloc(entries * sizeof(int));
|
||||||
|
Reference in New Issue
Block a user