mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
mov: do not misreport empty stts
Return -1 instead of ENOMEM if entries is 0. Fixes a av_malloc(0) crash in macosx.
This commit is contained in:
parent
5a7ba58657
commit
30c3d976f1
@ -1461,8 +1461,8 @@ static int mov_read_stts(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
|||||||
av_dlog(c->fc, "track[%i].stts.entries = %i\n",
|
av_dlog(c->fc, "track[%i].stts.entries = %i\n",
|
||||||
c->fc->nb_streams-1, entries);
|
c->fc->nb_streams-1, entries);
|
||||||
|
|
||||||
if (entries >= UINT_MAX / sizeof(*sc->stts_data))
|
if (!entries || entries >= UINT_MAX / sizeof(*sc->stts_data))
|
||||||
return -1;
|
return AVERROR(EINVAL);
|
||||||
|
|
||||||
sc->stts_data = av_malloc(entries * sizeof(*sc->stts_data));
|
sc->stts_data = av_malloc(entries * sizeof(*sc->stts_data));
|
||||||
if (!sc->stts_data)
|
if (!sc->stts_data)
|
||||||
|
Loading…
Reference in New Issue
Block a user