From Rolf Fiedler:

patch to fix mp2t.c to reject more byte streams that are not MPEG2.

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7132

svn path=/trunk/; revision=42127
This commit is contained in:
Anders Broman 2012-04-18 08:32:12 +00:00
parent 7422d0ad08
commit ec0c5baf4f
1 changed files with 3 additions and 2 deletions

View File

@ -179,9 +179,10 @@ mp2t_open(wtap *wth, int *err, gchar **err_info)
bytes_read = file_read(buffer, MP2T_SIZE+trailer_len, wth->fh);
if (bytes_read < 0)
return -1; /* read error */
if (bytes_read < MP2T_SIZE+trailer_len)
if (bytes_read < MP2T_SIZE+trailer_len) {
if(sync_steps<2) return 0; /* wrong file type - not an mpeg2 ts file */
break; /* end of file, that's ok if we're still in sync */
}
if (buffer[0] == MP2T_SYNC_BYTE) {
sync_steps++;
}