summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorscop <scop>2005-08-26 18:12:31 +0000
committerscop <scop>2005-08-26 18:12:31 +0000
commit836657232b829fc99c3b080c525009d6f668c2c6 (patch)
tree7522d230d9570f416dca53fb9ca848549f80e449
parentc3600695b54210e828a2d0b9d549f75bed718e33 (diff)
downloadvdr-plugin-dxr3-836657232b829fc99c3b080c525009d6f668c2c6.tar.gz
vdr-plugin-dxr3-836657232b829fc99c3b080c525009d6f668c2c6.tar.bz2
Don't abort with lpcm frames containing an odd number of bytes, drop instead.
-rw-r--r--HISTORY2
-rw-r--r--dxr3audiodecoder.c8
2 files changed, 8 insertions, 2 deletions
diff --git a/HISTORY b/HISTORY
index 977cb0a..5226eb7 100644
--- a/HISTORY
+++ b/HISTORY
@@ -299,3 +299,5 @@ NOTE: I havent found time to include all of the languages, will be done in pre2
- renamed dxr3interface_spu_encoder.[ch] to dxr3spuencoder.[ch]
(Christian Gmeiner)
- use dxr3 hardware dvd playback functions in spudecoder (Christian Gmeiner)
+- don't abort with lpcm frames containing an odd number of bytes, drop
+ the frame instead (Ville Skyttä)
diff --git a/dxr3audiodecoder.c b/dxr3audiodecoder.c
index 67238d2..f742375 100644
--- a/dxr3audiodecoder.c
+++ b/dxr3audiodecoder.c
@@ -202,10 +202,14 @@ void cDxr3AudioDecoder::DecodeLpcm(const uint8_t* buf, int length,
{
if (length > (LPCM_HEADER_LENGTH + 2))
{
- uint8_t* pFrame = new uint8_t[length - LPCM_HEADER_LENGTH];
// only even number of bytes are allowed
- assert(!((length - LPCM_HEADER_LENGTH) % 2));
+ if ((length - LPCM_HEADER_LENGTH) % 2 != 0)
+ {
+ esyslog("dxr3: audiodecoder: skipping %d lpcm bytes", length);
+ return;
+ }
+ uint8_t* pFrame = new uint8_t[length - LPCM_HEADER_LENGTH];
for (int i = LPCM_HEADER_LENGTH; i < length; i += 2)
{
pFrame[i - LPCM_HEADER_LENGTH] = buf[i + 1];