From 530a4eab23613f24144f20bd8f22d07ea2a26cf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Mangano?= Date: Tue, 1 Jan 2013 16:54:36 +0100 Subject: [PATCH] fix lost page (before eof) --- opustags.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/opustags.c b/opustags.c index bc3a40c..d92a6c3 100644 --- a/opustags.c +++ b/opustags.c @@ -140,9 +140,11 @@ int main(int argc, char **argv){ size_t len; char *error = NULL; int packet_count = -1; - while(error == NULL && !feof(in)){ + while(error == NULL){ // Read until we complete a page. if(ogg_sync_pageout(&oy, &og) != 1){ + if(feof(in)) + break; buf = ogg_sync_buffer(&oy, 65536); if(buf == NULL){ error = "ogg_sync_buffer: out of memory";