avcodec/hevc_ps: prevent stale pointer in malloc failure case

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0fc2045d5f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer
2014-07-15 21:43:04 +02:00
parent a4e1532ee7
commit 51dd23c448

View File

@@ -959,6 +959,8 @@ int ff_hevc_decode_nal_sps(HEVCContext *s)
if (s->sps_list[sps_id] && s->sps == (HEVCSPS*)s->sps_list[sps_id]->data) {
av_buffer_unref(&s->current_sps);
s->current_sps = av_buffer_ref(s->sps_list[sps_id]);
if (!s->current_sps)
s->sps = NULL;
}
av_buffer_unref(&s->sps_list[sps_id]);
s->sps_list[sps_id] = sps_buf;