diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-07-15 21:43:04 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-07-15 22:19:25 +0200 |
commit | 0bb71a85c398cae8a66885e357490f68d38c80ac (patch) | |
tree | 679120b3e40018b4f645f6a068d88bcb16ba1652 | |
parent | 5302fa522bcf0da381fcc671ec0c22c7fbcdd73a (diff) | |
download | ffmpeg-0bb71a85c398cae8a66885e357490f68d38c80ac.tar.gz |
avcodec/hevc_ps: prevent stale pointer in malloc failure case
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0fc2045d5f4eab35d943a79c3d965a2f31361f48)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit cf99ce9a7744763ea2950f45e7ffe18af8f4e0f5)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/hevc_ps.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/hevc_ps.c b/libavcodec/hevc_ps.c index 99ac8efa0d..955a7afe5d 100644 --- a/libavcodec/hevc_ps.c +++ b/libavcodec/hevc_ps.c @@ -937,6 +937,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; |