avcodec/dynamic_hdr10_plus: don't take a GetBitContext as input argument

Create a local one instead from a byte buffer input argument.
This prevents skipping bytes that may belong to another SEI message.

Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer
2020-12-06 12:30:14 -03:00
parent b9f7c9b272
commit 1aa72fe794
3 changed files with 18 additions and 7 deletions

View File

@@ -20,15 +20,16 @@
#define AVCODEC_DYNAMIC_HDR10_PLUS_H
#include "libavutil/hdr_dynamic_metadata.h"
#include "get_bits.h"
/**
* Parse the user data registered ITU-T T.35 to AVbuffer (AVDynamicHDRPlus).
* @param gb The bit content to be decoded.
* @param s A pointer containing the decoded AVDynamicHDRPlus structure.
* @param data The byte array containing the raw ITU-T T.35 data.
* @param size Size of the data array in bytes.
*
* @return 0 if succeed. Otherwise, returns the appropriate AVERROR.
*/
int ff_parse_itu_t_t35_to_dynamic_hdr10_plus(GetBitContext *gb, AVDynamicHDRPlus *s);
int ff_parse_itu_t_t35_to_dynamic_hdr10_plus(AVDynamicHDRPlus *s, const uint8_t *data,
int size);
#endif /* AVCODEC_DYNAMIC_HDR10_PLUS_H */