Ticket #697: patchticket697.diff

File patchticket697.diff, 822 bytes (added by cehoyos, 5 years ago)
  • libavcodec/h264_ps.c

    diff --git a/libavcodec/h264_ps.c b/libavcodec/h264_ps.c
    index ad364fb..c0f4cd4 100644
    a b int ff_h264_decode_picture_parameter_set(H264Context *h, int bit_length){ 
    580580    memcpy(pps->scaling_matrix8, h->sps_buffers[pps->sps_id]->scaling_matrix8, sizeof(pps->scaling_matrix8)); 
    581581 
    582582    bits_left = bit_length - get_bits_count(&s->gb); 
    583     if(bits_left > 0 && more_rbsp_data_in_pps(h, pps)){ 
     583    if(bits_left && (bits_left > 8 || show_bits(&s->gb, bits_left) != 1 << (bits_left - 1))) { 
    584584        pps->transform_8x8_mode= get_bits1(&s->gb); 
    585585        decode_scaling_matrices(h, h->sps_buffers[pps->sps_id], pps, 0, pps->scaling_matrix4, pps->scaling_matrix8); 
    586586        pps->chroma_qp_index_offset[1]= get_se_golomb(&s->gb); //second_chroma_qp_index_offset