diff mbox series

[FFmpeg-devel,06/11] avformat/daudenc: Return proper error codes instead if -1

Message ID 20200718001928.10603-5-andreas.rheinhardt@gmail.com
State Accepted
Commit 3d114c102a945718b2141d952a47a0f8226235d2
Headers show
Series [FFmpeg-devel,01/11] avformat/webmdashenc: Fix segfault when no filename is given when live
Related show

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Andreas Rheinhardt July 18, 2020, 12:19 a.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavformat/daudenc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/libavformat/daudenc.c b/libavformat/daudenc.c
index 0d8d830a67..b489659a80 100644
--- a/libavformat/daudenc.c
+++ b/libavformat/daudenc.c
@@ -25,7 +25,7 @@  static int daud_init(struct AVFormatContext *s)
 {
     AVCodecParameters *par = s->streams[0]->codecpar;
     if (par->channels!=6 || par->sample_rate!=96000)
-        return -1;
+        return AVERROR(EINVAL);
     return 0;
 }
 
@@ -34,7 +34,7 @@  static int daud_write_packet(struct AVFormatContext *s, AVPacket *pkt)
     if (pkt->size > 65535) {
         av_log(s, AV_LOG_ERROR,
                "Packet size too large for s302m. (%d > 65535)\n", pkt->size);
-        return -1;
+        return AVERROR_INVALIDDATA;
     }
     avio_wb16(s->pb, pkt->size);
     avio_wb16(s->pb, 0x8010); // unknown