]> granicus.if.org Git - handbrake/commitdiff
libav: remove a pointless check in the DTS decoder.
authorTim Walker <tdskywalker@gmail.com>
Sat, 21 Nov 2015 23:26:54 +0000 (00:26 +0100)
committerTim Walker <tdskywalker@gmail.com>
Sat, 21 Nov 2015 23:26:54 +0000 (00:26 +0100)
The check resulted in an error with many real-world streams,
which are otherwise perfectly valid. The auxiliary data length
is not reliable and/or the ETSI DTS specification is incorrect.

contrib/ffmpeg/A10-dcadec-false-overread.patch [new file with mode: 0644]

diff --git a/contrib/ffmpeg/A10-dcadec-false-overread.patch b/contrib/ffmpeg/A10-dcadec-false-overread.patch
new file mode 100644 (file)
index 0000000..50ca001
--- /dev/null
@@ -0,0 +1,23 @@
+diff --git a/libavcodec/dcadec.c b/libavcodec/dcadec.c
+index e988e94..a72195e 100644
+--- a/libavcodec/dcadec.c
++++ b/libavcodec/dcadec.c
+@@ -1359,12 +1359,12 @@ static int dca_subframe_footer(DCAContext *s, int base_channel)
+             align_get_bits(&s->gb); // byte align
+             skip_bits(&s->gb, 16);  // nAUXCRC16
+-            // additional data (reserved, cf. ETSI TS 102 114 V1.4.1)
+-            if ((reserved = (aux_data_end - get_bits_count(&s->gb))) < 0) {
+-                 av_log(s->avctx, AV_LOG_ERROR,
+-                        "Overread auxiliary data by %d bits\n", -reserved);
+-                return AVERROR_INVALIDDATA;
+-            } else if (reserved) {
++            /*
++             * additional data (reserved, cf. ETSI TS 102 114 V1.4.1)
++             *
++             * Note: don't check for overreads, aux_data_count can't be trusted.
++             */
++            if ((reserved = (aux_data_end - get_bits_count(&s->gb))) > 0) {
+                 avpriv_request_sample(s->avctx,
+                                       "Core auxiliary data reserved content");
+                 skip_bits_long(&s->gb, reserved);