diff mbox

[FFmpeg-devel,2/2] avformat/movenc: Check packet in mov_write_single_packet() too

Message ID 20160915223703.19392-2-michael@niedermayer.cc
State Accepted
Commit 28343139330f557e00293933a4697c7d0fc19c56
Headers show

Commit Message

Michael Niedermayer Sept. 15, 2016, 10:37 p.m. UTC
Fixes assertion failure

Found-by: durandal117
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavformat/movenc.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Paul B Mahol Sept. 16, 2016, 9:39 a.m. UTC | #1
On 9/16/16, Michael Niedermayer <michael@niedermayer.cc> wrote:
> Fixes assertion failure
>
> Found-by: durandal117
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavformat/movenc.c | 4 ++++
>  1 file changed, 4 insertions(+)
>

lgtm
Michael Niedermayer Sept. 16, 2016, 9:46 a.m. UTC | #2
On Fri, Sep 16, 2016 at 11:39:21AM +0200, Paul B Mahol wrote:
> On 9/16/16, Michael Niedermayer <michael@niedermayer.cc> wrote:
> > Fixes assertion failure
> >
> > Found-by: durandal117
> > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> > ---
> >  libavformat/movenc.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> 
> lgtm

applied

thanks

[...]
diff mbox

Patch

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 2d8fc48..b704f49 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -4971,6 +4971,10 @@  static int mov_write_single_packet(AVFormatContext *s, AVPacket *pkt)
         int64_t frag_duration = 0;
         int size = pkt->size;
 
+        int ret = check_pkt(s, pkt);
+        if (ret < 0)
+            return ret;
+
         if (mov->flags & FF_MOV_FLAG_FRAG_DISCONT) {
             int i;
             for (i = 0; i < s->nb_streams; i++)