From 1c1a16a95ec4cbcc3345667b1f2eb7b2307f2845 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96man?= Date: Sat, 16 Jan 2010 22:25:36 +0000 Subject: [PATCH] Fix another bug in the section reassembly code --- src/psi.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/psi.c b/src/psi.c index 6cb7b4d6..b6348244 100644 --- a/src/psi.c +++ b/src/psi.c @@ -37,7 +37,7 @@ psi_section_reassemble0(psi_section_t *ps, const uint8_t *data, int len, int start, int crc, section_handler_t *cb, void *opaque) { - int excess, tsize, s; + int excess, tsize; if(start) { // Payload unit start indicator @@ -66,9 +66,8 @@ psi_section_reassemble0(psi_section_t *ps, const uint8_t *data, if(crc && psi_crc32(ps->ps_data, tsize)) return -1; - s = tsize - (crc ? 4 : 0); - - cb(ps->ps_data, s, opaque); + cb(ps->ps_data, tsize - (crc ? 4 : 0), opaque); + ps->ps_offset = 0; return len - excess; }