Skip to content

Commit 106616f

Browse files
committed
avformat/mov: tighten sample count value in mov_read_sdtp
sc->sample_count and sc->sdtp_count are both unsigned ints. Fixes Coverity issue CID 168634. Signed-off-by: James Almer <[email protected]>
1 parent 292056e commit 106616f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

libavformat/mov.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3680,7 +3680,8 @@ static int mov_read_sdtp(MOVContext *c, AVIOContext *pb, MOVAtom atom)
36803680
{
36813681
AVStream *st;
36823682
MOVStreamContext *sc;
3683-
int64_t i, entries;
3683+
unsigned int i;
3684+
int64_t entries;
36843685

36853686
if (c->fc->nb_streams < 1)
36863687
return 0;
@@ -3699,7 +3700,7 @@ static int mov_read_sdtp(MOVContext *c, AVIOContext *pb, MOVAtom atom)
36993700
av_freep(&sc->sdtp_data);
37003701
sc->sdtp_count = 0;
37013702

3702-
if (entries < 0 || entries > SIZE_MAX)
3703+
if (entries < 0 || entries > UINT_MAX)
37033704
return AVERROR(ERANGE);
37043705

37053706
sc->sdtp_data = av_malloc(entries);

0 commit comments

Comments
 (0)