[FFmpeg-cvslog] apedec: return meaningful error values in ape_decode_frame()

Justin Ruggles git at videolan.org
Sat Oct 29 02:31:37 CEST 2011


ffmpeg | branch: master | Justin Ruggles <justin.ruggles at gmail.com> | Tue Oct 11 11:55:56 2011 -0400| [91b71460b5b2ba1060314d5811029159a013fcac] | committer: Justin Ruggles

apedec: return meaningful error values in ape_decode_frame()

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

 libavcodec/apedec.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c
index 9a15bfb..a754fd7 100644
--- a/libavcodec/apedec.c
+++ b/libavcodec/apedec.c
@@ -820,7 +820,7 @@ static int ape_decode_frame(AVCodecContext *avctx,
     /* should not happen but who knows */
     if (BLOCKS_PER_LOOP * 2 * avctx->channels > *data_size) {
         av_log (avctx, AV_LOG_ERROR, "Output buffer is too small.\n");
-        return -1;
+        return AVERROR(EINVAL);
     }
 
     if(!s->samples){
@@ -834,7 +834,7 @@ static int ape_decode_frame(AVCodecContext *avctx,
         if(n < 0 || n > 3){
             av_log(avctx, AV_LOG_ERROR, "Incorrect offset passed\n");
             s->data = NULL;
-            return -1;
+            return AVERROR_INVALIDDATA;
         }
         s->ptr += n;
 
@@ -871,7 +871,7 @@ static int ape_decode_frame(AVCodecContext *avctx,
     if(s->error || s->ptr > s->data_end){
         s->samples=0;
         av_log(avctx, AV_LOG_ERROR, "Error decoding frame\n");
-        return -1;
+        return AVERROR_INVALIDDATA;
     }
 
     for (i = 0; i < blockstodecode; i++) {



More information about the ffmpeg-cvslog mailing list