Module: libav
Branch: release/11
Commit: 8fb48db22d44c5afb2f2d67145d2febc172e8d06

Author:    Anton Khirnov <[email protected]>
Committer: Anton Khirnov <[email protected]>
Date:      Wed Jul 20 13:39:10 2016 +0200

h264: only allow starting a new picture in the first slice thread

Decoding different pictures in different slice threads simultaneously
leads to all kinds of UB.

Bug-Id: 690

---

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

diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index c2c3e9f..8d4b342 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -1216,6 +1216,12 @@ int ff_h264_decode_slice_header(H264Context *h, 
H264Context *h0)
         }
     }
 
+    if (!h0->current_slice && h != h0) {
+        av_log(h->avctx, AV_LOG_ERROR,
+               "A new picture can only be started in the first slice 
thread\n");
+        return AVERROR(ENOSYS);
+    }
+
     slice_type = get_ue_golomb_31(&h->gb);
     if (slice_type > 9) {
         av_log(h->avctx, AV_LOG_ERROR,

_______________________________________________
libav-commits mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-commits

Reply via email to