From 8acf00954ffaca72d879be5bcf0c50c2a08a12be Mon Sep 17 00:00:00 2001 From: seanbright Date: Mon, 22 Sep 2008 22:49:00 +0000 Subject: Use the advertised header size in .au files instead of just assuming they are 24 bytes (the minimum). (closes issue #13450) Reported by: jamessan Patches: pcm-header.diff uploaded by jamessan (license 246) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@143903 f38db490-d61c-443f-a65b-d21fe96a405b --- formats/format_pcm.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/formats/format_pcm.c b/formats/format_pcm.c index 7b186e602..a3deced7a 100644 --- a/formats/format_pcm.c +++ b/formats/format_pcm.c @@ -284,9 +284,10 @@ static int check_header(FILE *f) if (magic != (uint32_t) AU_MAGIC) { ast_log(LOG_WARNING, "Bad magic: 0x%x\n", magic); } -/* hdr_size = ltohl(header[AU_HDR_HDR_SIZE_OFF]); - if (hdr_size < AU_HEADER_SIZE)*/ - hdr_size = AU_HEADER_SIZE; + hdr_size = ltohl(header[AU_HDR_HDR_SIZE_OFF]); + if (hdr_size < AU_HEADER_SIZE) { + hdr_size = AU_HEADER_SIZE; + } /* data_size = ltohl(header[AU_HDR_DATA_SIZE_OFF]); */ encoding = ltohl(header[AU_HDR_ENCODING_OFF]); if (encoding != AU_ENC_8BIT_ULAW) { -- cgit v1.2.3