Ticket #3232: segfault_fix.diff

File segfault_fix.diff, 1.8 KB (added by Mark.Buechler@…, 17 years ago)

Patch from the ffmpeg dev list which fixes the segfault in libavcodec wrt PAFF interlaced streams.

  • h264.c

     
    46594659        s->picture_structure= PICT_FRAME;
    46604660    }else{
    46614661        if(get_bits1(&s->gb)) { //field_pic_flag
    4662             s->picture_structure= PICT_TOP_FIELD + get_bits1(&s->gb); //bottom_field_flag
     4662            //s->picture_structure= PICT_TOP_FIELD + get_bits1(&s->gb); //bottom_field_flag
    46634663            av_log(h->s.avctx, AV_LOG_ERROR, "PAFF interlacing is not implemented\n");
     4664            return -1;
    46644665        } else {
    46654666            s->picture_structure= PICT_FRAME;
    46664667            h->mb_aff_frame = h->sps.mb_aff;
     
    47164717    if(h->slice_type == P_TYPE || h->slice_type == SP_TYPE || h->slice_type == B_TYPE){
    47174718        if(h->slice_type == B_TYPE){
    47184719            h->direct_spatial_mv_pred= get_bits1(&s->gb);
    4719             if(h->sps.mb_aff && h->direct_spatial_mv_pred)
     4720            if(h->sps.mb_aff && h->direct_spatial_mv_pred){
    47204721                av_log(h->s.avctx, AV_LOG_ERROR, "MBAFF + spatial direct mode is not implemented\n");
     4722                return -1;
     4723            }
    47214724        }
    47224725        num_ref_idx_active_override_flag= get_bits1(&s->gb);
    47234726
     
    81758178
    81768179            if(decode_slice_header(h) < 0){
    81778180                av_log(h->s.avctx, AV_LOG_ERROR, "decode_slice_header error\n");
    8178                 break;
     8181                return -1;
    81798182            }
    81808183            s->current_picture_ptr->key_frame= (h->nal_unit_type == NAL_IDR_SLICE);
    81818184            if(h->redundant_pic_count==0 && s->hurry_up < 5
     
    81938196
    81948197            if(decode_slice_header(h) < 0){
    81958198                av_log(h->s.avctx, AV_LOG_ERROR, "decode_slice_header error\n");
     8199                return -1;
    81968200            }
    81978201            break;
    81988202        case NAL_DPB: