Layers 1 and 2 use lengths in bits which are not a multiple of 8,
and our CRC works on a per-byte basis.
Based on
b48397e7b8
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: James Almer <jamrial@gmail.com>
if (s->error_protection) {
uint16_t crc = get_bits(&s->gb, 16);
- if (s->err_recognition & AV_EF_CRCCHECK) {
+ if (s->err_recognition & AV_EF_CRCCHECK && s->layer == 3) {
const int sec_len = s->lsf ? ((s->nb_channels == 1) ? 9 : 17) :
((s->nb_channels == 1) ? 17 : 32);
const AVCRC *crc_tab = av_crc_get_table(AV_CRC_16_ANSI);