Browse Source

mpegaudiodec_template: disable CRC checking for layers 1 and 2

Layers 1 and 2 use lengths in bits which are not a multiple of 8,
and our CRC works on a per-byte basis.
tags/n4.4
Lynne 5 years ago
parent
commit
b48397e7b8
No known key found for this signature in database GPG Key ID: A2FEA5F03F034464
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavcodec/mpegaudiodec_template.c

+ 1
- 1
libavcodec/mpegaudiodec_template.c View File

@@ -1566,7 +1566,7 @@ static int mp_decode_frame(MPADecodeContext *s, OUT_INT **samples,

init_get_bits(&s->gb, buf + HEADER_SIZE, (buf_size - HEADER_SIZE) * 8);

if (s->error_protection) {
if (s->error_protection && s->layer == 3) {
uint16_t crc = get_bits(&s->gb, 16);
if (s->err_recognition & AV_EF_CRCCHECK) {
const int sec_len = s->lsf ? ((s->nb_channels == 1) ? 9 : 17) :


Loading…
Cancel
Save