diff options
author | Hendrik Leppkes <h.leppkes@gmail.com> | 2015-08-07 10:54:12 +0300 |
---|---|---|
committer | Hendrik Leppkes <h.leppkes@gmail.com> | 2015-08-07 10:54:12 +0300 |
commit | 8015150f43875531f05e31ac5021ea676fb20e40 (patch) | |
tree | a92d988815cb6efbd66a87b3b67e7240c76eb39f /libavcodec/h264.h | |
parent | 3d2d6728288fd6c00f119774ab2c86a6423813a5 (diff) | |
parent | 9469370fb32679352e66826daf77bdd2e6f067b5 (diff) |
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>
Diffstat (limited to 'libavcodec/h264.h')
-rw-r--r-- | libavcodec/h264.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libavcodec/h264.h b/libavcodec/h264.h index 2b5029a749..153668de45 100644 --- a/libavcodec/h264.h +++ b/libavcodec/h264.h @@ -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; } |