History

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

James Almer committed 1 year ago

Commit fd1772b1 parent 8eb1d761 file · +1 −1Browse files

Unified · Split

libavformat/mov.c+1−1
@@ -5191,7 +5191,7 @@ static int mov_read_trak(MOVContext *c, AVIOContext *pb, MOVAtom atom) · 5190 unmodified lines
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;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t