[FFmpeg-cvslog] lavc/dvbsub: return meaningful error codes

John Stebbins git at videolan.org
Sat Apr 11 02:53:47 EEST 2020


ffmpeg | branch: master | John Stebbins <jstebbins at jetheaddev.com> | Fri Apr 10 12:08:46 2020 -0600| [75a845886386bdb1399516f17094aa5d194b9b82] | committer: Philip Langdale

lavc/dvbsub: return meaningful error codes

Signed-off-by: Philip Langdale <philipl at overt.org>

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

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

diff --git a/libavcodec/dvbsub.c b/libavcodec/dvbsub.c
index a0be0b1056..5c081f2b71 100644
--- a/libavcodec/dvbsub.c
+++ b/libavcodec/dvbsub.c
@@ -282,7 +282,7 @@ static int encode_dvb_subtitles(AVCodecContext *avctx,
     page_id = 1;
 
     if (h->num_rects && !h->rects)
-        return -1;
+        return AVERROR(EINVAL);
 
     if (avctx->width > 0 && avctx->height > 0) {
         if (buf_size < 11)
@@ -341,7 +341,7 @@ static int encode_dvb_subtitles(AVCodecContext *avctx,
                 /* 8 bpp, standard encoding */
                 bpp_index = 2;
             } else {
-                return -1;
+                return AVERROR(EINVAL);
             }
 
 
@@ -393,7 +393,7 @@ static int encode_dvb_subtitles(AVCodecContext *avctx,
             /* 8 bpp, standard encoding */
             bpp_index = 2;
         } else {
-            return -1;
+            return AVERROR(EINVAL);
         }
 
         *q++ = 0x0f; /* sync_byte */
@@ -441,7 +441,7 @@ static int encode_dvb_subtitles(AVCodecContext *avctx,
                 /* 8 bpp, standard encoding */
                 dvb_encode_rle = dvb_encode_rle8;
             } else {
-                return -1;
+                return AVERROR(EINVAL);
             }
 
             /* Object Data segment */



More information about the ffmpeg-cvslog mailing list