Skip to content

Commit fd1772b

Browse files
committed
avformat/mov: fix potential unsigned underflow in loop condition
if sc->tts_count is 0, this condition will wrap around to UINT_MAX and the code will try to dereference a NULL pointer. Fixes ticket #11417 Signed-off-by: James Almer <[email protected]>
1 parent 8eb1d76 commit fd1772b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libavformat/mov.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5191,7 +5191,7 @@ static int mov_read_trak(MOVContext *c, AVIOContext *pb, MOVAtom atom)
51915191
}
51925192

51935193
#if FF_API_R_FRAME_RATE
5194-
for (int i = 1; sc->stts_count && i < sc->tts_count - 1; i++) {
5194+
for (unsigned int i = 1; sc->stts_count && i + 1 < sc->tts_count; i++) {
51955195
if (sc->tts_data[i].duration == sc->tts_data[0].duration)
51965196
continue;
51975197
stts_constant = 0;

0 commit comments

Comments
 (0)