summaryrefslogtreecommitdiffstats
path: root/libavcodec/h264.h
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2015-08-07 09:54:12 +0200
committerHendrik Leppkes <h.leppkes@gmail.com>2015-08-07 09:54:12 +0200
commit8015150f43875531f05e31ac5021ea676fb20e40 (patch)
treea92d988815cb6efbd66a87b3b67e7240c76eb39f /libavcodec/h264.h
parent3d2d6728288fd6c00f119774ab2c86a6423813a5 (diff)
parent9469370fb32679352e66826daf77bdd2e6f067b5 (diff)
downloadffmpeg-streaming-8015150f43875531f05e31ac5021ea676fb20e40.zip
ffmpeg-streaming-8015150f43875531f05e31ac5021ea676fb20e40.tar.gz
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.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/libavcodec/h264.h b/libavcodec/h264.h
index 2b5029a..153668d 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;
}
OpenPOWER on IntegriCloud