summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <[email protected]>2014-07-15 21:43:30 +0200
committerMichael Niedermayer <[email protected]>2014-08-05 04:13:38 +0200
commit815d3225e32bc335cecd333773d1839d63b76abf (patch)
treeb67f6a1fe0dabf61152d9a227cde9f083a795e66
parent51dd23c4488b345850b4eb5d75c322ace5989c43 (diff)
avcodec/hevc: treat current_sps like sps_list
This simplifies the management of current_sps Fixes Ticket3458 Signed-off-by: Michael Niedermayer <[email protected]> (cherry picked from commit 880dbe43ca71982ecdfe1c73446137d6b2fd24d5) Signed-off-by: Michael Niedermayer <[email protected]>
-rw-r--r--libavcodec/hevc.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c
index fd0309af60..5f719c8561 100644
--- a/libavcodec/hevc.c
+++ b/libavcodec/hevc.c
@@ -2941,9 +2941,12 @@ static int hevc_update_thread_context(AVCodecContext *dst,
}
}
- if (s->current_sps && s->sps == (HEVCSPS*)s->current_sps->data)
- s->sps = NULL;
av_buffer_unref(&s->current_sps);
+ if (s0->current_sps) {
+ s->current_sps = av_buffer_ref(s0->current_sps);
+ if (!s->current_sps)
+ return AVERROR(ENOMEM);
+ }
if (s->sps != s0->sps)
ret = set_sps(s, s0->sps);