Commit 0fc2045d authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/hevc_ps: prevent stale pointer in malloc failure case

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 95144729
...@@ -1016,6 +1016,8 @@ int ff_hevc_decode_nal_sps(HEVCContext *s) ...@@ -1016,6 +1016,8 @@ int ff_hevc_decode_nal_sps(HEVCContext *s)
if (s->sps_list[sps_id] && s->sps == (HEVCSPS*)s->sps_list[sps_id]->data) { if (s->sps_list[sps_id] && s->sps == (HEVCSPS*)s->sps_list[sps_id]->data) {
av_buffer_unref(&s->current_sps); av_buffer_unref(&s->current_sps);
s->current_sps = av_buffer_ref(s->sps_list[sps_id]); 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]); av_buffer_unref(&s->sps_list[sps_id]);
s->sps_list[sps_id] = sps_buf; s->sps_list[sps_id] = sps_buf;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment