diff options
author | James Almer <jamrial@gmail.com> | 2022-10-22 16:41:41 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2022-10-26 10:18:33 -0300 |
commit | 4c35bb53f94e4de88a0919346f24d34f8387771c (patch) | |
tree | d1f6b43ab9cd13b671a64693e551acb03bade290 /libavcodec/aac_ac3_parser.h | |
parent | ffb691878359fd80c0b675e015765ccd0d2d467e (diff) | |
download | ffmpeg-4c35bb53f94e4de88a0919346f24d34f8387771c.tar.gz |
avcodec/ac3_parser: improve false positive detection when parsing sync frames
A two byte sync word is not enough to ensure we got a real syncframe, nor are
all the range checks we do in the first seven bytes. Do therefore an integrity
check for the sync frame in order to prevent the parser from filling avctx with
bogus information.
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/aac_ac3_parser.h')
-rw-r--r-- | libavcodec/aac_ac3_parser.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/aac_ac3_parser.h b/libavcodec/aac_ac3_parser.h index 560bba54f5..bc16181a19 100644 --- a/libavcodec/aac_ac3_parser.h +++ b/libavcodec/aac_ac3_parser.h @@ -24,6 +24,7 @@ #define AVCODEC_AAC_AC3_PARSER_H #include <stdint.h> +#include "libavutil/crc.h" #include "avcodec.h" #include "parser.h" @@ -42,6 +43,7 @@ typedef struct AACAC3ParseContext { int header_size; int (*sync)(uint64_t state, int *need_next_header, int *new_frame_start); + const AVCRC *crc_ctx; int remaining_size; uint64_t state; |