Merge "Return transport decoder error in case of invalid ELD configuration"
diff --git a/libMpegTPDec/src/tpdec_asc.cpp b/libMpegTPDec/src/tpdec_asc.cpp
index a81a137..5270f2b 100644
--- a/libMpegTPDec/src/tpdec_asc.cpp
+++ b/libMpegTPDec/src/tpdec_asc.cpp
@@ -1420,6 +1420,10 @@
           if (ErrorStatus != TRANSPORTDEC_OK) {
             return TRANSPORTDEC_PARSE_ERROR;
           }
+          if (esc->m_downscaledSamplingFrequency != asc->m_samplingFrequency) {
+            return TRANSPORTDEC_UNSUPPORTED_FORMAT; /* ELDv2 w/ ELD downscaled
+                                                       mode not allowed */
+          }
           break;
         }
 
@@ -1441,6 +1445,10 @@
         if (downscale_fill_nibble != 0x0) {
           return TRANSPORTDEC_PARSE_ERROR;
         }
+        if (esc->m_useLdQmfTimeAlign == 1) {
+          return TRANSPORTDEC_UNSUPPORTED_FORMAT; /* ELDv2 w/ ELD downscaled
+                                                     mode not allowed */
+        }
         break;
     }
   }