aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/mp2t.c
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2012-04-18 08:32:12 +0000
committerAnders Broman <anders.broman@ericsson.com>2012-04-18 08:32:12 +0000
commitec0c5baf4f9485ec73b31ccad1d1366094faedf5 (patch)
tree02d62c05e6c7cab4a16bc49fa36691b5fa1652ef /wiretap/mp2t.c
parent7422d0ad08e3b9559d093aaee3c47f275f1b101f (diff)
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
Diffstat (limited to 'wiretap/mp2t.c')
-rw-r--r--wiretap/mp2t.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/wiretap/mp2t.c b/wiretap/mp2t.c
index 7133d96d66..c5cbeb88a8 100644
--- a/wiretap/mp2t.c
+++ b/wiretap/mp2t.c
@@ -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++;
}