History

avformat/mpegts: Fix probing of mpegts with invalid ASC

Fixes Ticket5566

Michael Niedermayer committed 10 years ago

Commit e01b19d1 parent a2e6c781 file · +10 −7Browse files

Unified · Split

libavformat/mpegts.c+10−7
@@ -542,13 +542,16 @@ static int analyze(const uint8_t *buf, int size, int packet_size, · 541 unmodified lines
542542 memset(stat, 0, packet_size * sizeof(*stat));
543543
544544 for (i = 0; i < size - 3; i++) {
545− if (buf[i] == 0x47 &&
546− (!probe || (buf[i + 3] & 0x30))) {
547− int x = i % packet_size;
548− stat[x]++;
549− stat_all++;
550− if (stat[x] > best_score) {
551− best_score = stat[x];
545+ if (buf[i] == 0x47) {
546+ int pid = AV_RB16(buf+1) & 0x1FFF;
547+ int asc = buf[i + 3] & 0x30;
548+ if (!probe || pid == 0x1FFF || asc) {
549+ int x = i % packet_size;
550+ stat[x]++;
551+ stat_all++;
552+ if (stat[x] > best_score) {
553+ best_score = stat[x];
554+ }
552555 }
553556 }
554557 }

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