aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-04-02 17:59:10 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-04-02 17:59:10 +0200
commit4ce776d63691afd39900b5be48e20c4c42ae8057 (patch)
treec52f6732969e44c5f02e7c0665c5c07b36b2d275
parent0d5e6843b421c643574da7ba2cc148ce6025f6f6 (diff)
downloadffmpeg-4ce776d63691afd39900b5be48e20c4c42ae8057.tar.gz
H264: fix slice end error detection
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/h264.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 92eb46b7d3..d48aa3ea8a 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -3116,7 +3116,8 @@ static int decode_slice(struct AVCodecContext *avctx, void *arg){
if(s->mb_y >= s->mb_height){
tprintf(s->avctx, "slice end %d %d\n", get_bits_count(&s->gb), s->gb.size_in_bits);
- if(get_bits_count(&s->gb) == s->gb.size_in_bits ) {
+ if( get_bits_count(&s->gb) == s->gb.size_in_bits
+ || get_bits_count(&s->gb) < s->gb.size_in_bits && s->avctx->error_recognition < FF_ER_AGGRESSIVE) {
ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x-1, s->mb_y, (AC_END|DC_END|MV_END)&part_mask);
return 0;