diff mbox

[FFmpeg-devel,2/6] avformat/aiffenc: Use better error codes

Message ID 20191023125944.10292-2-andreas.rheinhardt@gmail.com
State Accepted
Commit f53525d248634b6a68f37baefc5028d364ba0bff
Headers show

Commit Message

Andreas Rheinhardt Oct. 23, 2019, 12:59 p.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavformat/aiffenc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Michael Niedermayer Oct. 24, 2019, 5:51 p.m. UTC | #1
On Wed, Oct 23, 2019 at 02:59:40PM +0200, Andreas Rheinhardt wrote:
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
> ---
>  libavformat/aiffenc.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

will apply

thx

[...]
diff mbox

Patch

diff --git a/libavformat/aiffenc.c b/libavformat/aiffenc.c
index 4f24c2a28c..acf7b62862 100644
--- a/libavformat/aiffenc.c
+++ b/libavformat/aiffenc.c
@@ -123,7 +123,7 @@  static int aiff_write_header(AVFormatContext *s)
 
     /* First verify if format is ok */
     if (!par->codec_tag)
-        return -1;
+        return AVERROR(EINVAL);
     if (par->codec_tag != MKTAG('N','O','N','E'))
         aifc = 1;
 
@@ -136,7 +136,7 @@  static int aiff_write_header(AVFormatContext *s)
     if (aifc) { // compressed audio
         if (!par->block_align) {
             av_log(s, AV_LOG_ERROR, "block align not set\n");
-            return -1;
+            return AVERROR(EINVAL);
         }
         /* Version chunk */
         ffio_wfourcc(pb, "FVER");
@@ -167,7 +167,7 @@  static int aiff_write_header(AVFormatContext *s)
         par->bits_per_coded_sample = av_get_bits_per_sample(par->codec_id);
     if (!par->bits_per_coded_sample) {
         av_log(s, AV_LOG_ERROR, "could not compute bits per sample\n");
-        return -1;
+        return AVERROR(EINVAL);
     }
     if (!par->block_align)
         par->block_align = (par->bits_per_coded_sample * par->channels) >> 3;