]> git.sesse.net Git - ffmpeg/commitdiff
lavc/assenc: return more meaningful error code
authorJohn Stebbins <jstebbins@jetheaddev.com>
Fri, 10 Apr 2020 18:15:26 +0000 (12:15 -0600)
committerPhilip Langdale <philipl@overt.org>
Fri, 10 Apr 2020 22:58:04 +0000 (15:58 -0700)
When the buffer is too small, return AVERROR_BUFFER_TOO_SMALL

Signed-off-by: Philip Langdale <philipl@overt.org>
libavcodec/assenc.c

index e54c1d8ec39b720cc64eea7abc66d31c8ec4a067..a6e1d5d8b908be3f5b09ebdbe0c227b4ba969f4e 100644 (file)
@@ -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;