[FFmpeg-cvslog] avcodec/hevc_ps: prevent stale pointer in malloc failure case

Michael Niedermayer git at videolan.org
Tue Aug 5 04:58:07 CEST 2014


ffmpeg | branch: release/2.2 | Michael Niedermayer <michaelni at gmx.at> | Tue Jul 15 21:43:04 2014 +0200| [51dd23c4488b345850b4eb5d75c322ace5989c43] | committer: Michael Niedermayer

avcodec/hevc_ps: prevent stale pointer in malloc failure case

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

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=51dd23c4488b345850b4eb5d75c322ace5989c43
---

 libavcodec/hevc_ps.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/hevc_ps.c b/libavcodec/hevc_ps.c
index 669aba9..c8350fb 100644
--- a/libavcodec/hevc_ps.c
+++ b/libavcodec/hevc_ps.c
@@ -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;



More information about the ffmpeg-cvslog mailing list