aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/vb.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2012-11-17 15:17:34 +0100
committerAnton Khirnov <anton@khirnov.net>2013-01-06 13:31:40 +0100
commit9dbbda235d93d628777b986e502213f1ed390973 (patch)
tree578bab3e29087301a16f49436eb394646ec7125a /libavcodec/vb.c
parenta0ffcee1ee813977b6e0834c265846a092373379 (diff)
downloadffmpeg-9dbbda235d93d628777b986e502213f1ed390973.tar.gz
vb: return meaningful error codes.
Diffstat (limited to 'libavcodec/vb.c')
-rw-r--r--libavcodec/vb.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libavcodec/vb.c b/libavcodec/vb.c
index 1e241e7d5a..4f2b7648b8 100644
--- a/libavcodec/vb.c
+++ b/libavcodec/vb.c
@@ -123,7 +123,7 @@ static int vb_decode_framedata(VBDecContext *c, int offset)
if(!t){ //raw block
if (bytestream2_get_bytes_left(&g) < 16) {
av_log(c->avctx, AV_LOG_ERROR, "Insufficient data\n");
- return -1;
+ return AVERROR_INVALIDDATA;
}
for(y = 0; y < 4; y++)
bytestream2_get_buffer(&g, cur + y * width, 4);
@@ -168,7 +168,7 @@ static int vb_decode_framedata(VBDecContext *c, int offset)
break;
case 3:
av_log(c->avctx, AV_LOG_ERROR, "Invalid opcode seen @%d\n",blk);
- return -1;
+ return AVERROR_INVALIDDATA;
}
break;
}
@@ -190,7 +190,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
{
VBDecContext * const c = avctx->priv_data;
uint8_t *outptr, *srcptr;
- int i, j;
+ int i, j, ret;
int flags;
uint32_t size;
int offset = 0;
@@ -200,9 +200,9 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
if(c->pic.data[0])
avctx->release_buffer(avctx, &c->pic);
c->pic.reference = 1;
- if(ff_get_buffer(avctx, &c->pic) < 0){
+ if ((ret = ff_get_buffer(avctx, &c->pic)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
- return -1;
+ return ret;
}
flags = bytestream2_get_le16(&c->stream);