[FFmpeg-cvslog] flashsv: Return more meaningful error values.

Diego Biurrun git at videolan.org
Tue Apr 26 04:23:17 CEST 2011


ffmpeg | branch: master | Diego Biurrun <diego at biurrun.de> | Mon Apr 25 16:01:58 2011 +0200| [a14c08247d2e207b344e335e1cea774c99419fed] | committer: Diego Biurrun

flashsv: Return more meaningful error values.

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

 libavcodec/flashsv.c    |    2 +-
 libavcodec/flashsvenc.c |    6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavcodec/flashsv.c b/libavcodec/flashsv.c
index 0fdbfde..1e8afdb 100644
--- a/libavcodec/flashsv.c
+++ b/libavcodec/flashsv.c
@@ -133,7 +133,7 @@ static int flashsv_decode_frame(AVCodecContext *avctx, void *data,
         av_free(s->tmpblock);
         if ((s->tmpblock = av_malloc(3 * s->block_width * s->block_height)) == NULL) {
             av_log(avctx, AV_LOG_ERROR, "Can't allocate decompression buffer.\n");
-            return -1;
+            return AVERROR(ENOMEM);
         }
     }
     s->block_size = s->block_width * s->block_height;
diff --git a/libavcodec/flashsvenc.c b/libavcodec/flashsvenc.c
index 9a72b07..ccd5fc3 100644
--- a/libavcodec/flashsvenc.c
+++ b/libavcodec/flashsvenc.c
@@ -106,7 +106,7 @@ static av_cold int flashsv_encode_init(AVCodecContext *avctx)
 
     if ((avctx->width > 4095) || (avctx->height > 4095)) {
         av_log(avctx, AV_LOG_ERROR, "Input dimensions too large, input must be max 4096x4096 !\n");
-        return -1;
+        return AVERROR_INVALIDDATA;
     }
 
     // Needed if zlib unused or init aborted before deflateInit
@@ -122,7 +122,7 @@ static av_cold int flashsv_encode_init(AVCodecContext *avctx)
 
     if (!s->tmpblock || !s->encbuffer) {
         av_log(avctx, AV_LOG_ERROR, "Memory allocation failed.\n");
-        return -1;
+        return AVERROR(ENOMEM);
     }
 
     return 0;
@@ -222,7 +222,7 @@ static int flashsv_encode_frame(AVCodecContext *avctx, uint8_t *buf,
         s->previous_frame = av_mallocz(FFABS(p->linesize[0]) * s->image_height);
         if (!s->previous_frame) {
             av_log(avctx, AV_LOG_ERROR, "Memory allocation failed.\n");
-            return -1;
+            return AVERROR(ENOMEM);
         }
         I_frame = 1;
     }



More information about the ffmpeg-cvslog mailing list