From 7dcc9c664e5d4f5116f9872ea3fab4a84b61fa40 Mon Sep 17 00:00:00 2001 From: Lloyd Parkes Date: Sun, 16 Oct 2022 12:50:49 +1300 Subject: [PATCH] And another place we need to lseek() after dup(). --- libs/fst/fstapi.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/fst/fstapi.cc b/libs/fst/fstapi.cc index f1b726518..da0d959a0 100644 --- a/libs/fst/fstapi.cc +++ b/libs/fst/fstapi.cc @@ -3607,6 +3607,7 @@ static int fstReaderRecreateHierFile(struct fstReaderContext *xc) fflush(xc->f); #endif zfd = dup(fileno(xc->f)); + lseek(zfd, ftell(xc->f), SEEK_SET); zhandle = gzdopen(zfd, "rb"); if (!zhandle) { close(zfd);