Merge commit 'ce0bc09ee2580d49fec90a6eb0de2ba1b580c854'
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 3 Apr 2015 19:37:03 +0000 (21:37 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 3 Apr 2015 19:37:03 +0000 (21:37 +0200)
* commit 'ce0bc09ee2580d49fec90a6eb0de2ba1b580c854':
  hevc: do not change the VPS if its contents are the same

Conflicts:
libavcodec/hevc_ps.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavcodec/hevc_ps.c

@@@ -452,14 -407,14 +452,20 @@@ int ff_hevc_decode_nal_vps(HEVCContext 
      }
      get_bits1(gb); /* vps_extension_flag */
  
-     av_buffer_unref(&s->vps_list[vps_id]);
-     s->vps_list[vps_id] = vps_buf;
 +    if (get_bits_left(gb) < 0) {
 +        av_log(s->avctx, AV_LOG_ERROR,
 +               "Overread VPS by %d bits\n", -get_bits_left(gb));
 +        goto err;
 +    }
 +
+     if (s->vps_list[vps_id] &&
+         !memcmp(s->vps_list[vps_id]->data, vps_buf->data, vps_buf->size)) {
+         av_buffer_unref(&vps_buf);
+     } else {
+         av_buffer_unref(&s->vps_list[vps_id]);
+         s->vps_list[vps_id] = vps_buf;
+     }
      return 0;
  
  err: