mirror of
https://github.com/xenia-project/FFmpeg.git
synced 2024-11-30 23:10:32 +00:00
Merge commit '9469370fb32679352e66826daf77bdd2e6f067b5'
* commit '9469370fb32679352e66826daf77bdd2e6f067b5': h264: Use AVERROR return codes instead of -1 Only partially merged, as the first hunk is not correct and would result in endless log spam. Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
This commit is contained in:
commit
8015150f43
@ -1191,15 +1191,16 @@ static inline int get_avc_nalsize(H264Context *h, const uint8_t *buf,
|
||||
{
|
||||
int i, nalsize = 0;
|
||||
|
||||
if (*buf_index >= buf_size - h->nal_length_size)
|
||||
return -1;
|
||||
if (*buf_index >= buf_size - h->nal_length_size) {
|
||||
return AVERROR(EAGAIN);
|
||||
}
|
||||
|
||||
for (i = 0; i < h->nal_length_size; i++)
|
||||
nalsize = ((unsigned)nalsize << 8) | buf[(*buf_index)++];
|
||||
if (nalsize <= 0 || nalsize > buf_size - *buf_index) {
|
||||
av_log(h->avctx, AV_LOG_ERROR,
|
||||
"AVC: nal size %d\n", nalsize);
|
||||
return -1;
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
return nalsize;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user