[FFmpeg-devel] [PATCH] Check av_dup_packet() return code

Michael Niedermayer michael at niedermayer.cc
Sun Jun 5 15:24:32 CEST 2016


On Thu, Mar 03, 2016 at 05:15:07PM +0100, Michael Niedermayer wrote:
> On Wed, Feb 03, 2016 at 11:27:00PM +0100, Andreas Cadhalpun wrote:
> > On 03.02.2016 19:05, Michael Niedermayer wrote:
> > > Fixes: CID1338320
> > > 
> > > Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> > > ---
> > >  libavcodec/frame_thread_encoder.c |    4 +++-
> > >  1 file changed, 3 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/libavcodec/frame_thread_encoder.c b/libavcodec/frame_thread_encoder.c
> > > index 04c9a0e..27ae356 100644
> > > --- a/libavcodec/frame_thread_encoder.c
> > > +++ b/libavcodec/frame_thread_encoder.c
> > > @@ -89,7 +89,9 @@ static void * attribute_align_arg worker(void *v){
> > >          pthread_mutex_unlock(&c->buffer_mutex);
> > >          av_frame_free(&frame);
> > >          if(got_packet) {
> > > -            av_dup_packet(pkt);
> > > +            int ret2 = av_dup_packet(pkt);
> > > +            if (ret >= 0 && ret2 < 0)
> > > +                ret = ret2;
> > >          } else {
> > >              pkt->data = NULL;
> > >              pkt->size = 0;
> > > 
> > 
> > Checking the return code this way is probably OK, but maybe you can also replace the
> > deprecated av_dup_packet with av_packet_ref while at it?
> 
> ill apply this patch in a few days if there are no objections
> as noone suggested another solution

now what was the definition of few ....

forgotten
applied

thx

[...]


-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Breaking DRM is a little like attempting to break through a door even
though the window is wide open and the only thing in the house is a bunch
of things you dont want and which you would get tomorrow for free anyway
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160605/158a1c2f/attachment.sig>


More information about the ffmpeg-devel mailing list