diff options
author | James Almer <jamrial@gmail.com> | 2017-07-19 07:53:22 +0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2017-07-21 18:18:10 +0300 |
commit | 7c9d2ad45f4e46ad2c3b2e93051efbe1e0d0529e (patch) | |
tree | 8e09f06e0aacaaeab767a406766d53e79b8acd1a /libavcodec/dca.c | |
parent | 99c5ac20397ec1814d6a50bed74cadd421ad8b9d (diff) |
avcodec/dca: remove GetBitContext usage from avpriv_dca_parse_core_frame_header()
This prevents potential ABI issues with GetBitContext.
Reviewed-by: foo86 <foobaz86@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/dca.c')
-rw-r--r-- | libavcodec/dca.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/libavcodec/dca.c b/libavcodec/dca.c index 39f8f3d81c..307b21471e 100644 --- a/libavcodec/dca.c +++ b/libavcodec/dca.c @@ -88,7 +88,7 @@ int avpriv_dca_convert_bitstream(const uint8_t *src, int src_size, uint8_t *dst, } } -int avpriv_dca_parse_core_frame_header(GetBitContext *gb, DCACoreFrameHeader *h) +int ff_dca_parse_core_frame_header(DCACoreFrameHeader *h, GetBitContext *gb) { if (get_bits_long(gb, 32) != DCA_SYNCWORD_CORE_BE) return DCA_PARSE_ERROR_SYNC_WORD; @@ -145,3 +145,13 @@ int avpriv_dca_parse_core_frame_header(GetBitContext *gb, DCACoreFrameHeader *h) h->dn_code = get_bits(gb, 4); return 0; } + +int avpriv_dca_parse_core_frame_header(DCACoreFrameHeader *h, uint8_t *buf, int size) +{ + GetBitContext gb; + + if (init_get_bits8(&gb, buf, size) < 0) + return DCA_PARSE_ERROR_INVALIDDATA; + + return ff_dca_parse_core_frame_header(h, &gb); +} |