From ec0c5baf4f9485ec73b31ccad1d1366094faedf5 Mon Sep 17 00:00:00 2001 From: Anders Broman Date: Wed, 18 Apr 2012 08:32:12 +0000 Subject: 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 --- wiretap/mp2t.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'wiretap/mp2t.c') 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++; } -- cgit v1.2.3