summaryrefslogtreecommitdiffstats
path: root/libavcodec/h264_mp4toannexb_bsf.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-12-29 03:42:15 +0100
committerMichael Niedermayer <michaelni@gmx.at>2011-12-29 21:01:41 +0100
commit7ae251b4d8a18bc63734e58f1baafac634c67e01 (patch)
treed2edac0cad201c64182431380332f1b83d1156f6 /libavcodec/h264_mp4toannexb_bsf.c
parent377dfa3d9915fed6c21a6e14525b825f32380540 (diff)
downloadffmpeg-streaming-7ae251b4d8a18bc63734e58f1baafac634c67e01.zip
ffmpeg-streaming-7ae251b4d8a18bc63734e58f1baafac634c67e01.tar.gz
h264_mp4toannexb_filter: pass error code through.
Bug-Found-by and Suggested bugfix: Tanami, Ohad Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/h264_mp4toannexb_bsf.c')
-rw-r--r--libavcodec/h264_mp4toannexb_bsf.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/libavcodec/h264_mp4toannexb_bsf.c b/libavcodec/h264_mp4toannexb_bsf.c
index e85bdb6..5085ecb 100644
--- a/libavcodec/h264_mp4toannexb_bsf.c
+++ b/libavcodec/h264_mp4toannexb_bsf.c
@@ -63,6 +63,7 @@ static int h264_mp4toannexb_filter(AVBitStreamFilterContext *bsfc,
int32_t nal_size;
uint32_t cumul_size = 0;
const uint8_t *buf_end = buf + buf_size;
+ int ret = AVERROR(EINVAL);
/* nothing to filter */
if (!avctx->extradata || avctx->extradata_size < 6) {
@@ -137,6 +138,7 @@ pps:
*poutbuf_size = 0;
*poutbuf = NULL;
do {
+ ret= AVERROR(EINVAL);
if (buf + ctx->length_size > buf_end)
goto fail;
@@ -155,15 +157,15 @@ pps:
/* prepend only to the first type 5 NAL unit of an IDR picture */
if (ctx->first_idr && unit_type == 5) {
- if (alloc_and_copy(poutbuf, poutbuf_size,
+ if ((ret=alloc_and_copy(poutbuf, poutbuf_size,
avctx->extradata, avctx->extradata_size,
- buf, nal_size) < 0)
+ buf, nal_size)) < 0)
goto fail;
ctx->first_idr = 0;
} else {
- if (alloc_and_copy(poutbuf, poutbuf_size,
+ if ((ret=alloc_and_copy(poutbuf, poutbuf_size,
NULL, 0,
- buf, nal_size) < 0)
+ buf, nal_size)) < 0)
goto fail;
if (!ctx->first_idr && unit_type == 1)
ctx->first_idr = 1;
@@ -178,7 +180,7 @@ pps:
fail:
av_freep(poutbuf);
*poutbuf_size = 0;
- return AVERROR(EINVAL);
+ return ret;
}
AVBitStreamFilter ff_h264_mp4toannexb_bsf = {
OpenPOWER on IntegriCloud