[FFmpeg-cvslog] lavc/libvorbisdec: use better error codes

Lukasz Marek git at videolan.org
Sun Nov 23 03:35:11 CET 2014


ffmpeg | branch: master | Lukasz Marek <lukasz.m.luki2 at gmail.com> | Sat Nov 22 22:45:10 2014 +0100| [f87a34486af06c2c396d4dd1df8ffb74eaf77459] | committer: Lukasz Marek

lavc/libvorbisdec: use better error codes

Signed-off-by: Lukasz Marek <lukasz.m.luki2 at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f87a34486af06c2c396d4dd1df8ffb74eaf77459
---

 libavcodec/libvorbisdec.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavcodec/libvorbisdec.c b/libavcodec/libvorbisdec.c
index f2c5046..db00572 100644
--- a/libavcodec/libvorbisdec.c
+++ b/libavcodec/libvorbisdec.c
@@ -40,7 +40,7 @@ static int oggvorbis_decode_init(AVCodecContext *avccontext) {
 
     if(! avccontext->extradata_size || ! p) {
         av_log(avccontext, AV_LOG_ERROR, "vorbis extradata absent\n");
-        return -1;
+        return AVERROR(EINVAL);
     }
 
     vorbis_info_init(&context->vi) ;
@@ -65,7 +65,7 @@ static int oggvorbis_decode_init(AVCodecContext *avccontext) {
             if(offset >= avccontext->extradata_size - 1) {
                 av_log(avccontext, AV_LOG_ERROR,
                        "vorbis header sizes damaged\n");
-                ret = -1;
+                ret = AVERROR_INVALIDDATA;
                 goto error;
             }
             hsizes[i] += *p;
@@ -84,7 +84,7 @@ static int oggvorbis_decode_init(AVCodecContext *avccontext) {
     } else {
         av_log(avccontext, AV_LOG_ERROR,
                "vorbis initial header len is wrong: %d\n", *p);
-        ret = -1;
+        ret = AVERROR_INVALIDDATA;
         goto error;
     }
 
@@ -94,7 +94,7 @@ static int oggvorbis_decode_init(AVCodecContext *avccontext) {
         context->op.packet = headers[i];
         if(vorbis_synthesis_headerin(&context->vi, &context->vc, &context->op)<0){
             av_log(avccontext, AV_LOG_ERROR, "%d. vorbis header damaged\n", i+1);
-            ret = -1;
+            ret = AVERROR_INVALIDDATA;
             goto error;
         }
     }



More information about the ffmpeg-cvslog mailing list