[FFmpeg-cvslog] avcodec/h264: Do not get stuck on IDR inter frames

Michael Niedermayer git at videolan.org
Sun Aug 31 04:10:34 CEST 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Aug 31 03:43:56 2014 +0200| [e0237208b428d4da20cbb361c74b2086528faaf7] | committer: Michael Niedermayer

avcodec/h264: Do not get stuck on IDR inter frames

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

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

 libavcodec/h264.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 8ed9f48..0fcc769 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");



More information about the ffmpeg-cvslog mailing list