Fix large timebases.
[libav.git] / libavcodec / h264_ps.c
index 3fc3442..6b9e6e9 100644 (file)
@@ -176,7 +176,7 @@ static inline int decode_vui_parameters(H264Context *h, SPS *sps){
     if(sps->timing_info_present_flag){
         sps->num_units_in_tick = get_bits_long(&s->gb, 32);
         sps->time_scale = get_bits_long(&s->gb, 32);
-        if(sps->num_units_in_tick-1 > 0x7FFFFFFEU || sps->time_scale-1 > 0x7FFFFFFEU){
+        if(!sps->num_units_in_tick || !sps->time_scale){
             av_log(h->s.avctx, AV_LOG_ERROR, "time_scale/num_units_in_tick invalid or unsupported (%d/%d)\n", sps->time_scale, sps->num_units_in_tick);
             return -1;
         }
@@ -501,7 +501,7 @@ int ff_h264_decode_picture_parameter_set(H264Context *h, int bit_length){
     build_qp_table(pps, 0, pps->chroma_qp_index_offset[0]);
     build_qp_table(pps, 1, pps->chroma_qp_index_offset[1]);
     if(pps->chroma_qp_index_offset[0] != pps->chroma_qp_index_offset[1])
-        h->pps.chroma_qp_diff= 1;
+        pps->chroma_qp_diff= 1;
 
     if(s->avctx->debug&FF_DEBUG_PICT_INFO){
         av_log(h->s.avctx, AV_LOG_DEBUG, "pps:%u sps:%u %s slice_groups:%d ref:%d/%d %s qp:%d/%d/%d/%d %s %s %s %s\n",