Message ID | 1591972317-29664-1-git-send-email-lance.lmwang@gmail.com |
---|---|
State | Accepted |
Commit | 04172d233de58cbb5a2dab6839696628a97c7b52 |
Headers | show |
Series | [FFmpeg-devel,1/2] avformat/dvenc: return error code of dv_assemble_frame() | expand |
Context | Check | Description |
---|---|---|
andriy/default | pending | |
andriy/make | success | Make finished |
andriy/make_fate | success | Make fate finished |
On Fri, Jun 12, 2020 at 10:31:56PM +0800, lance.lmwang@gmail.com wrote: > From: Limin Wang <lance.lmwang@gmail.com> > > Signed-off-by: Limin Wang <lance.lmwang@gmail.com> > --- > libavformat/dvenc.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/libavformat/dvenc.c b/libavformat/dvenc.c > index c71e532..b04d604 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; > } > > -- > 1.8.3.1 > will apply the patchset tomorrow if no objection.
diff --git a/libavformat/dvenc.c b/libavformat/dvenc.c index c71e532..b04d604 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; }