mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-05-17 23:17:41 +08:00
rtmppkt: Add method to read an AMF string that is not prefixed by its type
Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:

committed by
Martin Storsjö

parent
a1859032e3
commit
3b18857ab3
@ -102,13 +102,11 @@ int ff_amf_read_number(GetByteContext *bc, double *val)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ff_amf_read_string(GetByteContext *bc, uint8_t *str,
|
||||
int strsize, int *length)
|
||||
int ff_amf_get_string(GetByteContext *bc, uint8_t *str,
|
||||
int strsize, int *length)
|
||||
{
|
||||
int stringlen = 0;
|
||||
int readsize;
|
||||
if (bytestream2_get_byte(bc) != AMF_DATA_TYPE_STRING)
|
||||
return AVERROR_INVALIDDATA;
|
||||
stringlen = bytestream2_get_be16(bc);
|
||||
if (stringlen + 1 > strsize)
|
||||
return AVERROR(EINVAL);
|
||||
@ -122,6 +120,14 @@ int ff_amf_read_string(GetByteContext *bc, uint8_t *str,
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ff_amf_read_string(GetByteContext *bc, uint8_t *str,
|
||||
int strsize, int *length)
|
||||
{
|
||||
if (bytestream2_get_byte(bc) != AMF_DATA_TYPE_STRING)
|
||||
return AVERROR_INVALIDDATA;
|
||||
return ff_amf_get_string(bc, str, strsize, length);
|
||||
}
|
||||
|
||||
int ff_amf_read_null(GetByteContext *bc)
|
||||
{
|
||||
if (bytestream2_get_byte(bc) != AMF_DATA_TYPE_NULL)
|
||||
|
Reference in New Issue
Block a user