handle_packets takes number of packets as arg, avoid reading too much
[ffmpeg.git] / libavformat / mpegts.c
index 300eb71a73ddde5993dd63f6b4aee689249723b6..8a888012875a5f13a14ed44619727b0b61f4b70f 100644 (file)
@@ -1377,7 +1377,7 @@ static int mpegts_read_header(AVFormatContext *s,
 
         mpegts_open_section_filter(ts, PAT_PID, pat_cb, ts, 1);
 
-        handle_packets(ts, s->probesize);
+        handle_packets(ts, s->probesize / ts->raw_packet_size);
         /* if could not find service, enable auto_guess */
 
         ts->auto_guess = 1;