From 5f348c5f740e28a56bf17dafdbe32de3febebde3 Mon Sep 17 00:00:00 2001
From: Matthias Vogelgesang <matthias.vogelgesang@kit.edu>
Date: Tue, 10 Feb 2015 14:44:00 +0100
Subject: Fix for new DMA filling

deadbeefs and other magic numbers can appear now ...
---
 src/ufodecode.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

(limited to 'src')

diff --git a/src/ufodecode.c b/src/ufodecode.c
index 03c4404..9f5851a 100644
--- a/src/ufodecode.c
+++ b/src/ufodecode.c
@@ -716,10 +716,13 @@ int ufo_decoder_get_next_frame(UfoDecoder     *decoder,
     pos += advance == 0 ? 1 : advance;
 
     /* if bytes left and we see fill bytes, skip them */
-    if (((pos + 2) < num_words) && ((raw[pos] == 0x0) && (raw[pos+1] == 0x1111111))) {
+    if (((pos + 2) < num_words) && ((raw[pos] == 0x0) && ((raw[pos+1] == 0x1111111) || raw[pos+1] == 0x0))) {
         pos += 2;
-        while ((pos < num_words) && ((raw[pos] == 0x89abcdef) || (raw[pos] == 0x1234567)))
+        while ((pos < num_words) &&
+               ((raw[pos] == 0x89abcdef) || (raw[pos] == 0x1234567) ||
+                (raw[pos] == 0x0) || (raw[pos] == 0xdeadbeef) || (0x98badcfe)))     /* new filling ... */ {
             pos++;
+        }
     }
 
     decoder->current_pos = pos;
-- 
cgit v1.2.3