# HG changeset patch # User Mychaela Falconia # Date 1715668284 28800 # Node ID 830af7de3403bf2cc370c195172b3977fda475da # Parent 4f81b959a5f5ad86cbde9e6fea525eda13f1fb61 sipout-test-voice: disallow empty files for play command diff -r 4f81b959a5f5 -r 830af7de3403 test-voice/rtp_tx.c --- a/test-voice/rtp_tx.c Mon May 13 22:10:25 2024 -0800 +++ b/test-voice/rtp_tx.c Mon May 13 22:31:24 2024 -0800 @@ -216,6 +216,11 @@ fprintf(stderr, "error: %s is not a regular file\n", filename); return; } + if (!st.st_size) { + close(fd); + fprintf(stderr, "error: %s is an empty file\n", filename); + return; + } if (st.st_size % 160) { close(fd); fprintf(stderr, @@ -260,6 +265,11 @@ fprintf(stderr, "error: %s is not a regular file\n", filename); return; } + if (!st.st_size) { + close(fd); + fprintf(stderr, "error: %s is an empty file\n", filename); + return; + } if (st.st_size % 160) { close(fd); fprintf(stderr,