[FFmpeg-devel] [PATCH] avcodec/h264_sei: Do not skip subsequent SEIs on error unless explode is set

Michael Niedermayer michael at niedermayer.cc
Sun Jun 12 12:49:34 CEST 2016


Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
 libavcodec/h264_sei.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/libavcodec/h264_sei.c b/libavcodec/h264_sei.c
index 95fc5da..1c6b0d7 100644
--- a/libavcodec/h264_sei.c
+++ b/libavcodec/h264_sei.c
@@ -425,6 +425,8 @@ static int decode_GreenMetadata(H264Context *h)
 
 int ff_h264_decode_sei(H264Context *h)
 {
+    int master_ret = 0;
+
     while (get_bits_left(&h->gb) > 16 && show_bits(&h->gb, 16)) {
         int type = 0;
         unsigned size = 0;
@@ -482,6 +484,8 @@ int ff_h264_decode_sei(H264Context *h)
             av_log(h->avctx, AV_LOG_DEBUG, "unknown SEI type %d\n", type);
         }
         if (ret < 0)
+            master_ret = ret;
+        if (ret < 0 && (h->avctx->err_recognition & AV_EF_EXPLODE))
             return ret;
 
         skip_bits_long(&h->gb, next - get_bits_count(&h->gb));
@@ -490,7 +494,7 @@ int ff_h264_decode_sei(H264Context *h)
         align_get_bits(&h->gb);
     }
 
-    return 0;
+    return master_ret;
 }
 
 const char* ff_h264_sei_stereo_mode(H264Context *h)
-- 
1.7.9.5



More information about the ffmpeg-devel mailing list