Index: libavcodec/ac3dec.c =================================================================== --- libs/libavcodec/ac3dec.c +++ libs/libavcodec/ac3dec.c @@ -37,6 +37,7 @@ #include "bitstream.h" #include "dsputil.h" #include "random.h" +#include "crc.h" /** * Table of bin locations for rematrixing bands @@ -1121,6 +1122,12 @@ return -1; } + if (av_crc(av_crc8005, 0, buf + 2, buf_size - 2)) { + av_log(avctx, AV_LOG_ERROR, "CRC error\n"); + *data_size = 0; + return buf_size; + } + avctx->sample_rate = ctx->sampling_rate; avctx->bit_rate = ctx->bit_rate;