Revision d23b28c7

View differences:

libavcodec/h264.c
6834 6834
    return 0;
6835 6835
}
6836 6836

  
6837
static inline void decode_hrd_parameters(H264Context *h, SPS *sps){
6837
static inline int decode_hrd_parameters(H264Context *h, SPS *sps){
6838 6838
    MpegEncContext * const s = &h->s;
6839 6839
    int cpb_count, i;
6840 6840
    cpb_count = get_ue_golomb(&s->gb) + 1;
6841

  
6842
    if(cpb_count > 32U){
6843
        av_log(h->s.avctx, AV_LOG_ERROR, "cpb_count %d invalid\n", cpb_count);
6844
        return -1;
6845
    }
6846

  
6841 6847
    get_bits(&s->gb, 4); /* bit_rate_scale */
6842 6848
    get_bits(&s->gb, 4); /* cpb_size_scale */
6843 6849
    for(i=0; i<cpb_count; i++){
......
6849 6855
    sps->cpb_removal_delay_length = get_bits(&s->gb, 5) + 1;
6850 6856
    sps->dpb_output_delay_length = get_bits(&s->gb, 5) + 1;
6851 6857
    sps->time_offset_length = get_bits(&s->gb, 5);
6858
    return 0;
6852 6859
}
6853 6860

  
6854 6861
static inline int decode_vui_parameters(H264Context *h, SPS *sps){
......
6903 6910

  
6904 6911
    sps->nal_hrd_parameters_present_flag = get_bits1(&s->gb);
6905 6912
    if(sps->nal_hrd_parameters_present_flag)
6906
        decode_hrd_parameters(h, sps);
6913
        if(decode_hrd_parameters(h, sps) < 0)
6914
            return -1;
6907 6915
    sps->vcl_hrd_parameters_present_flag = get_bits1(&s->gb);
6908 6916
    if(sps->vcl_hrd_parameters_present_flag)
6909
        decode_hrd_parameters(h, sps);
6917
        if(decode_hrd_parameters(h, sps) < 0)
6918
            return -1;
6910 6919
    if(sps->nal_hrd_parameters_present_flag || sps->vcl_hrd_parameters_present_flag)
6911 6920
        get_bits1(&s->gb);     /* low_delay_hrd_flag */
6912 6921
    sps->pic_struct_present_flag = get_bits1(&s->gb);

Also available in: Unified diff