diff options
-rw-r--r-- | libavcodec/hevc_ps.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/libavcodec/hevc_ps.c b/libavcodec/hevc_ps.c index 075a4bd915..f6e7ab93fd 100644 --- a/libavcodec/hevc_ps.c +++ b/libavcodec/hevc_ps.c @@ -458,8 +458,14 @@ int ff_hevc_decode_nal_vps(HEVCContext *s) goto err; } - av_buffer_unref(&s->vps_list[vps_id]); - s->vps_list[vps_id] = vps_buf; + 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: |