[libav-stable] [PATCH 1/1] h264: check context state before decoding slice data partitions

Janne Grunau janne-libav at jannau.net
Sat Jan 12 17:29:41 CET 2013


On 2013-01-12 17:00:43 +0100, Reinhard Tartler wrote:
> On Thu, Nov 29, 2012 at 2:45 PM, Janne Grunau <git at libav.org> wrote:
> > Module: libav
> > Branch: master
> > Commit: c1fcf563b13051f280db169ba41c6a1b21b25e08
> >
> > Author:    Janne Grunau <janne-libav at jannau.net>
> > Committer: Janne Grunau <janne-libav at jannau.net>
> > Date:      Wed Nov 28 22:17:14 2012 +0100
> >
> > h264: check context state before decoding slice data partitions
> >
> > Fixes mov_h264_aac__Demo_FlagOfOurFathers.mov.SIGSEGV.4e9.656.
> >
> > Found-by: Mateusz "j00ru" Jurczyk
> > CC: libav-stable at libav.org
> >
> > ---
> >
> >  libavcodec/h264.c |    1 +
> >  1 files changed, 1 insertions(+), 0 deletions(-)
> >
> > diff --git a/libavcodec/h264.c b/libavcodec/h264.c
> > index 8b9ac5c..e3075cb 100644
> > --- a/libavcodec/h264.c
> > +++ b/libavcodec/h264.c
> > @@ -3848,6 +3848,7 @@ again:
> >                  if (hx->redundant_pic_count == 0 &&
> >                      hx->intra_gb_ptr &&
> >                      hx->s.data_partitioning &&
> > +                    s->current_picture_ptr &&
> >                      s->context_initialized &&
> >                      (avctx->skip_frame < AVDISCARD_NONREF || hx->nal_ref_idc) &&
> >                      (avctx->skip_frame < AVDISCARD_BIDIR  ||
> 
> 
> This patch does not seem to apply to 0.8 at all, right?

not a patch, logically it is needed, adapted patch attached.

Janne
---8<---

Fixes mov_h264_aac__Demo_FlagOfOurFathers.mov.SIGSEGV.4e9.656.

Found-by: Mateusz "j00ru" Jurczyk
CC: libav-stable at libav.org
Signed-off-by: Janne Grunau <janne-libav at jannau.net>
---
 libavcodec/h264.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index ec8168e..4b0e52f5 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -4013,6 +4013,7 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size){
             hx->inter_gb_ptr= &hx->inter_gb;
 
             if(hx->redundant_pic_count==0 && hx->intra_gb_ptr && hx->s.data_partitioning
+               && s->current_picture_ptr
                && s->context_initialized
                && (avctx->skip_frame < AVDISCARD_NONREF || hx->nal_ref_idc)
                && (avctx->skip_frame < AVDISCARD_BIDIR  || hx->slice_type_nos!=AV_PICTURE_TYPE_B)
-- 
1.8.1



More information about the libav-stable mailing list