From patchwork Fri Apr 10 19:02:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stebbins X-Patchwork-Id: 18817 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 9E8A9449F93 for ; Fri, 10 Apr 2020 22:03:52 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8788B68B332; Fri, 10 Apr 2020 22:03:52 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail.jetheaddev.com (mail.jetheaddev.com [70.164.99.34]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id ABF6968B302 for ; Fri, 10 Apr 2020 22:03:46 +0300 (EEST) Received: from creator.alpe-d-promontory.fun (192.168.13.165) by cas.jetheaddev.com (192.168.13.27) with Microsoft SMTP Server (TLS) id 14.3.351.0; Fri, 10 Apr 2020 12:03:45 -0700 From: John Stebbins To: Date: Fri, 10 Apr 2020 13:02:18 -0600 Message-ID: <20200410190223.134413-3-jstebbins@jetheaddev.com> X-Mailer: git-send-email 2.25.2 In-Reply-To: <20200410190223.134413-1-jstebbins@jetheaddev.com> References: <20200410190223.134413-1-jstebbins@jetheaddev.com> MIME-Version: 1.0 X-Originating-IP: [192.168.13.165] Subject: [FFmpeg-devel] [PATCH 2/7] lavc/dvbsub: return meaningful error codes X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" --- 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 */