From 995e10ef36dbd7b994adc94eaa2ba5e4bae05da7 Mon Sep 17 00:00:00 2001 From: Anders Broman Date: Mon, 5 Mar 2012 08:34:36 +0000 Subject: From Martin Kaiser: wiretap mpeg2 ts: eof vs short read https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6909 svn path=/trunk/; revision=41350 --- 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 c797699859..03b9a58aaf 100644 --- a/wiretap/mp2t.c +++ b/wiretap/mp2t.c @@ -60,9 +60,10 @@ mp2t_read_data(guint8 *dest, int length, int *err, gchar **err_info, FILE_T fh) int bytes_read; bytes_read = file_read(dest, length, fh); - if (MP2T_SIZE != bytes_read) { + if (length != bytes_read) { *err = file_error(fh, err_info); - if (*err == 0) { + /* bytes_read==0 is end of file, not a short read */ + if (bytes_read>0 && *err == 0) { *err = WTAP_ERR_SHORT_READ; } return FALSE; -- cgit v1.2.1