1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-10 06:10:52 +02:00

avformat/mpegts: Fix probing of mpegts with invalid ASC

Fixes Ticket5566

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer
2016-06-07 15:46:08 +02:00
parent a2e6c785ce
commit e01b19dece

View File

@@ -542,13 +542,16 @@ static int analyze(const uint8_t *buf, int size, int packet_size,
memset(stat, 0, packet_size * sizeof(*stat)); memset(stat, 0, packet_size * sizeof(*stat));
for (i = 0; i < size - 3; i++) { for (i = 0; i < size - 3; i++) {
if (buf[i] == 0x47 && if (buf[i] == 0x47) {
(!probe || (buf[i + 3] & 0x30))) { int pid = AV_RB16(buf+1) & 0x1FFF;
int x = i % packet_size; int asc = buf[i + 3] & 0x30;
stat[x]++; if (!probe || pid == 0x1FFF || asc) {
stat_all++; int x = i % packet_size;
if (stat[x] > best_score) { stat[x]++;
best_score = stat[x]; stat_all++;
if (stat[x] > best_score) {
best_score = stat[x];
}
} }
} }
} }