[FFmpeg-devel] [PATCH 3/7] lavc/assenc: return more meaningful error code

John Stebbins jstebbins at jetheaddev.com
Fri Apr 10 22:02:19 EEST 2020


When the buffer is too small, return AVERROR_BUFFER_TOO_SMALL
---
 libavcodec/assenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/assenc.c b/libavcodec/assenc.c
index e54c1d8ec3..a6e1d5d8b9 100644
--- a/libavcodec/assenc.c
+++ b/libavcodec/assenc.c
@@ -93,7 +93,7 @@ static int ass_encode_frame(AVCodecContext *avctx,
 
         if (len > bufsize-total_len-1) {
             av_log(avctx, AV_LOG_ERROR, "Buffer too small for ASS event.\n");
-            return AVERROR(EINVAL);
+            return AVERROR_BUFFER_TOO_SMALL;
         }
 
         total_len += len;
-- 
2.25.2



More information about the ffmpeg-devel mailing list