avformat/dvenc: return error code of dv_assemble_frame()
authorLimin Wang <lance.lmwang@gmail.com>
Fri, 12 Jun 2020 13:06:25 +0000 (21:06 +0800)
committerLimin Wang <lance.lmwang@gmail.com>
Fri, 19 Jun 2020 15:12:49 +0000 (23:12 +0800)
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
libavformat/dvenc.c

index c71e532..b04d604 100644 (file)
@@ -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;
 }