From a1d6c1561d9dd0c3db61f5f3f62361c6094e9fc2 Mon Sep 17 00:00:00 2001 From: Xavier Wang Date: Mon, 19 Nov 2018 16:34:13 +0800 Subject: [PATCH] fix decode error when packed fields are not packed --- pb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pb.c b/pb.c index c620ee7..32f82f8 100644 --- a/pb.c +++ b/pb.c @@ -1629,7 +1629,7 @@ static void lpbD_map(lpb_Env *e, pb_Field *f) { static void lpbD_repeated(lpb_Env *e, pb_Field *f, uint32_t tag) { lua_State *L = e->L; lpb_fetchtable(e, f, NULL); - if (f->packed) { + if (f->packed && pb_gettype(tag) == PB_TBYTES) { int len = lua_rawlen(L, -1); lpb_SliceEx p, *s = e->s; lpb_readbytes(L, s, &p);