[FFmpeg-cvslog] avformat/dvenc: return error code of dv_assemble_frame()

Limin Wang git at videolan.org
Sat Jun 20 02:56:49 EEST 2020


ffmpeg | branch: master | Limin Wang <lance.lmwang at gmail.com> | Fri Jun 12 21:06:25 2020 +0800| [04172d233de58cbb5a2dab6839696628a97c7b52] | committer: Limin Wang

avformat/dvenc: return error code of dv_assemble_frame()

Signed-off-by: Limin Wang <lance.lmwang at gmail.com>

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

 libavformat/dvenc.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavformat/dvenc.c b/libavformat/dvenc.c
index c71e532771..b04d6044d7 100644
--- a/libavformat/dvenc.c
+++ b/libavformat/dvenc.c
@@ -406,9 +406,10 @@ static int dv_write_packet(struct AVFormatContext *s, AVPacket *pkt)
 
     fsize = dv_assemble_frame(s, s->priv_data, s->streams[pkt->stream_index],
                               pkt->data, pkt->size, &frame);
-    if (fsize > 0) {
-        avio_write(s->pb, frame, fsize);
+    if (fsize < 0) {
+        return fsize;
     }
+    avio_write(s->pb, frame, fsize);
     return 0;
 }
 



More information about the ffmpeg-cvslog mailing list