It's more consistent with other similar checks in the decoder, and should help with fuzzing.
Signed-off-by: James Almer <[email protected]> --- I could also add an AV_EF_EXPLODE check before aborting, but i figured that with a frame header crc failure it's pretty much guaranteed the file will be unplayable. libavcodec/flac.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/flac.c b/libavcodec/flac.c index 5ffbf93..8e1b059 100644 --- a/libavcodec/flac.c +++ b/libavcodec/flac.c @@ -135,7 +135,8 @@ int ff_flac_decode_frame_header(AVCodecContext *avctx, GetBitContext *gb, /* header CRC-8 check */ skip_bits(gb, 8); - if (av_crc(av_crc_get_table(AV_CRC_8_ATM), 0, gb->buffer, + if ((avctx->err_recognition & (AV_EF_CRCCHECK|AV_EF_COMPLIANT)) && + av_crc(av_crc_get_table(AV_CRC_8_ATM), 0, gb->buffer, get_bits_count(gb)/8)) { av_log(avctx, AV_LOG_ERROR + log_level_offset, "header crc mismatch\n"); -- 2.10.2 _______________________________________________ ffmpeg-devel mailing list [email protected] http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
