From 4f05038d7b71ec03ada011107122faffefaccf86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Mangano?= Date: Tue, 1 Jan 2013 20:59:30 +0100 Subject: [PATCH] short-circuit when in read-only mode --- opustags.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/opustags.c b/opustags.c index cb61ac0..b2a9707 100644 --- a/opustags.c +++ b/opustags.c @@ -365,7 +365,7 @@ int main(int argc, char **argv){ free_tags(&tags); if(raw_tags) free(raw_tags); - if(error) + if(error || !out) break; else continue; @@ -389,6 +389,8 @@ int main(int argc, char **argv){ else if(ogg_stream_check(&enc) != 0) error = "ogg_stream_check: internal error (encoder)"; } + else if(packet_count >= 2) // Read-only mode + break; } if(packet_count >= 0){ ogg_stream_clear(&os);