diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-08-31 03:43:56 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-08-31 04:09:06 +0200 |
commit | e0237208b428d4da20cbb361c74b2086528faaf7 (patch) | |
tree | fcb307da753144eb81fba96fa5ed77120db674f5 | |
parent | 8c63a0d171142329bd215c77c29cc38f91366ae0 (diff) | |
download | ffmpeg-e0237208b428d4da20cbb361c74b2086528faaf7.tar.gz |
avcodec/h264: Do not get stuck on IDR inter frames
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/h264.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 8ed9f48d09..0fcc769ef1 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -1567,6 +1567,12 @@ again: switch (hx->nal_unit_type) { case NAL_IDR_SLICE: + if ((ptr[0] & 0xFC) == 0x98) { + av_log(h->avctx, AV_LOG_ERROR, "Invalid inter IDR frame\n"); + h->next_outputed_poc = INT_MIN; + ret = -1; + goto end; + } if (h->nal_unit_type != NAL_IDR_SLICE) { av_log(h->avctx, AV_LOG_ERROR, "Invalid mix of idr and non-idr slices\n"); |