/**
* Extract an OBU from a raw bitstream.
*
- * @note This function does not copy or store any bistream data. All
+ * @note This function does not copy or store any bitstream data. All
* the pointers in the AV1OBU structure will be valid as long
* as the input buffer also is.
*/
/**
* Split an input packet into OBUs.
*
- * @note This function does not copy or store any bistream data. All
+ * @note This function does not copy or store any bitstream data. All
* the pointers in the AV1Packet structure will be valid as
* long as the input buffer also is.
*/
size = *obu_size + *start_pos;
- if (size > INT_MAX)
- return AVERROR(ERANGE);
+ if (size > buf_size)
+ return AVERROR_INVALIDDATA;
return size;
}