summaryrefslogtreecommitdiff
path: root/wiretap/mp2t.c
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2012-03-05 08:34:36 +0000
committerAnders Broman <anders.broman@ericsson.com>2012-03-05 08:34:36 +0000
commit995e10ef36dbd7b994adc94eaa2ba5e4bae05da7 (patch)
treecdc5562ba8e4fce2a3034e177dfe3f97385a2097 /wiretap/mp2t.c
parent4db442ab904dd3929270f1a5a603f024d9bd08dc (diff)
downloadwireshark-995e10ef36dbd7b994adc94eaa2ba5e4bae05da7.tar.gz
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
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 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;