summaryrefslogtreecommitdiff
path: root/libavcodec/h264_slice.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2015-09-02 00:44:28 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2015-09-02 01:22:45 +0200
commit1376084dcbab53cbaea8047cf7ec85af3c8570ce (patch)
tree67701e35a04b18a7907b507b831f838ad940123b /libavcodec/h264_slice.c
parent3eae98c1ac705d3f820a1800e81960146a80c61c (diff)
avcodec/h264_slice: replace assert by normal error check
Fixes assertion failure Fixes: c6075771557e4f3b7b74e63d2d24fb01/signal_sigabrt_7ffff6ac8cc9_133_cov_2853689970_CREDITS.FST Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/h264_slice.c')
-rw-r--r--libavcodec/h264_slice.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index 5c116b034b..a346ccbc00 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -1173,7 +1173,10 @@ int ff_h264_decode_slice_header(H264Context *h, H264SliceContext *sl)
if (first_mb_in_slice == 0) { // FIXME better field boundary detection
if (h->current_slice) {
- av_assert0(!h->setup_finished);
+ if (h->setup_finished) {
+ av_log(h->avctx, AV_LOG_ERROR, "Too many fields\n");
+ return AVERROR_INVALIDDATA;
+ }
if (h->cur_pic_ptr && FIELD_PICTURE(h) && h->first_field) {
ret = ff_h264_field_end(h, h->slice_ctx, 1);
h->current_slice = 0;