init_index does a magic 12 byte call to save_read but doesn't check to see if it worked.

From: Erik Hovland <erik@hovland.org>

It really should.
---

 programs/mythtranscode/replex/replex.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/programs/mythtranscode/replex/replex.c b/programs/mythtranscode/replex/replex.c
index 13b5d50..dfea4e6 100644
--- a/programs/mythtranscode/replex/replex.c
+++ b/programs/mythtranscode/replex/replex.c
@@ -1835,11 +1835,17 @@ void init_replex(struct replex *rx)
 		avi_context *ac;
 		uint8_t buf[AVI_S];
 		int re=0;
+		ssize_t read_count = 0;
 		
 		lseek(rx->fd_in, 0, SEEK_SET);
 		ac = &rx->ac;
 		memset(ac, 0, sizeof(avi_context));
-		save_read(rx, buf, 12);
+		if ((read_count = save_read(rx, buf, 12)) != 12) {
+			fprintf(stderr,
+				"Error reading in 12 bytes from replex. Read %d bytes\n",
+				read_count);
+			exit(1);
+		}
 		
 		if (check_riff(ac, buf, 12) < 0){
 			fprintf(stderr, "Wrong RIFF header\n");
