]> git.sesse.net Git - ffmpeg/commitdiff
lavc/dvbsub: return meaningful error codes
authorJohn Stebbins <jstebbins@jetheaddev.com>
Fri, 10 Apr 2020 18:08:46 +0000 (12:08 -0600)
committerPhilip Langdale <philipl@overt.org>
Fri, 10 Apr 2020 22:58:04 +0000 (15:58 -0700)
Signed-off-by: Philip Langdale <philipl@overt.org>
libavcodec/dvbsub.c

index a0be0b10563a237172a1fdf718d669781de02692..5c081f2b710054a98b96edc30bc9914e44d721a9 100644 (file)
@@ -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 */