Commit f87a3448 authored by Lukasz Marek's avatar Lukasz Marek

lavc/libvorbisdec: use better error codes

Signed-off-by: 's avatarLukasz Marek <lukasz.m.luki2@gmail.com>
parent bceabbda
...@@ -40,7 +40,7 @@ static int oggvorbis_decode_init(AVCodecContext *avccontext) { ...@@ -40,7 +40,7 @@ static int oggvorbis_decode_init(AVCodecContext *avccontext) {
if(! avccontext->extradata_size || ! p) { if(! avccontext->extradata_size || ! p) {
av_log(avccontext, AV_LOG_ERROR, "vorbis extradata absent\n"); av_log(avccontext, AV_LOG_ERROR, "vorbis extradata absent\n");
return -1; return AVERROR(EINVAL);
} }
vorbis_info_init(&context->vi) ; vorbis_info_init(&context->vi) ;
...@@ -65,7 +65,7 @@ static int oggvorbis_decode_init(AVCodecContext *avccontext) { ...@@ -65,7 +65,7 @@ static int oggvorbis_decode_init(AVCodecContext *avccontext) {
if(offset >= avccontext->extradata_size - 1) { if(offset >= avccontext->extradata_size - 1) {
av_log(avccontext, AV_LOG_ERROR, av_log(avccontext, AV_LOG_ERROR,
"vorbis header sizes damaged\n"); "vorbis header sizes damaged\n");
ret = -1; ret = AVERROR_INVALIDDATA;
goto error; goto error;
} }
hsizes[i] += *p; hsizes[i] += *p;
...@@ -84,7 +84,7 @@ static int oggvorbis_decode_init(AVCodecContext *avccontext) { ...@@ -84,7 +84,7 @@ static int oggvorbis_decode_init(AVCodecContext *avccontext) {
} else { } else {
av_log(avccontext, AV_LOG_ERROR, av_log(avccontext, AV_LOG_ERROR,
"vorbis initial header len is wrong: %d\n", *p); "vorbis initial header len is wrong: %d\n", *p);
ret = -1; ret = AVERROR_INVALIDDATA;
goto error; goto error;
} }
...@@ -94,7 +94,7 @@ static int oggvorbis_decode_init(AVCodecContext *avccontext) { ...@@ -94,7 +94,7 @@ static int oggvorbis_decode_init(AVCodecContext *avccontext) {
context->op.packet = headers[i]; context->op.packet = headers[i];
if(vorbis_synthesis_headerin(&context->vi, &context->vc, &context->op)<0){ if(vorbis_synthesis_headerin(&context->vi, &context->vc, &context->op)<0){
av_log(avccontext, AV_LOG_ERROR, "%d. vorbis header damaged\n", i+1); av_log(avccontext, AV_LOG_ERROR, "%d. vorbis header damaged\n", i+1);
ret = -1; ret = AVERROR_INVALIDDATA;
goto error; goto error;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment