avcodec/h264: Be more strict on rejecting pps_id changes

Fixes race condition
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2015-02-06 15:01:17 +01:00
parent dc3c3758ce
commit 31cc9c04ca
1 changed files with 2 additions and 2 deletions

View File

@ -1496,8 +1496,8 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size,
continue;
again:
if ( !(avctx->active_thread_type & FF_THREAD_FRAME)
|| nals_needed >= nal_index)
if ( (!(avctx->active_thread_type & FF_THREAD_FRAME) || nals_needed >= nal_index)
&& !h->current_slice)
h->au_pps_id = -1;
/* Ignore per frame NAL unit type during extradata
* parsing. Decoding slices is not possible in codec init