&&   !s->resync_marker
static int decode_slice(MpegEncContext *s){    s->last_resync_gb= s->gb;    s->first_slice_line= 1;            s->resync_mb_x= s->mb_x;    s->resync_mb_y= s->mb_y;    s->y_dc_scale= s->y_dc_scale_table[ s->qscale ];    s->c_dc_scale= s->c_dc_scale_table[ s->qscale ];        if(s->partitioned_frame){        const int qscale= s->qscale;        if(s->codec_id==CODEC_ID_MPEG4){            if(ff_mpeg4_decode_partitions(s) < 0)                return -1;         }                /* restore variables which where modified */        s->first_slice_line=1;        s->mb_x= s->resync_mb_x;        s->mb_y= s->resync_mb_y;        s->qscale= qscale;        s->y_dc_scale= s->y_dc_scale_table[ s->qscale ];        s->c_dc_scale= s->c_dc_scale_table[ s->qscale ];    }    for(; s->mb_y < s->mb_height; s->mb_y++) {        /* per-row end of slice checks */        if(s->msmpeg4_version){            if(s->resync_mb_y + s->slice_height == s->mb_y){                const int xy= s->mb_x + s->mb_y*s->mb_width;                s->error_status_table[xy-1]|= AC_END|DC_END|MV_END;                return 0;            }        }                if(s->msmpeg4_version==1){            s->last_dc[0]=            s->last_dc[1]=            s->last_dc[2]= 128;        }            ff_init_block_index(s);        for(; s->mb_x < s->mb_width; s->mb_x++) {            int ret;            ff_update_block_index(s);            if(s->resync_mb_x == s->mb_x && s->resync_mb_y+1 == s->mb_y){                s->first_slice_line=0;             }            /* DCT & quantize */	    s->dsp.clear_blocks(s->block[0]);                        s->mv_dir = MV_DIR_FORWARD;            s->mv_type = MV_TYPE_16X16;//            s->mb_skiped = 0;//printf("%d %d %06X\n", ret, get_bits_count(&s->gb), show_bits(&s->gb, 24));            ret= s->decode_mb(s, s->block);                        PRINT_QP("%2d", s->qscale);            MPV_decode_mb(s, s->block);            if(ret<0){                const int xy= s->mb_x + s->mb_y*s->mb_width;                if(ret==SLICE_END){//printf("%d %d %d %06X\n", s->mb_x, s->mb_y, s->gb.size*8 - get_bits_count(&s->gb), show_bits(&s->gb, 24));                    s->error_status_table[xy]|= AC_END;                    if(!s->partitioned_frame)                        s->error_status_table[xy]|= MV_END|DC_END;                    s->padding_bug_score--;                                            if(++s->mb_x >= s->mb_width){                        s->mb_x=0;                        ff_draw_horiz_band(s);                        s->mb_y++;                    }                    return 0;                 }else if(ret==SLICE_NOEND){                    fprintf(stderr,"Slice mismatch at MB: %d\n", xy);                    return -1;                }                fprintf(stderr,"Error at MB: %d\n", xy);                s->error_status_table[xy]|= AC_ERROR;                if(!s->partitioned_frame)                    s->error_status_table[xy]|= DC_ERROR|MV_ERROR;                    return -1;            }        }                ff_draw_horiz_band(s);                PRINT_QP("%s", "\n");                s->mb_x= 0;    }        assert(s->mb_x==0 && s->mb_y==s->mb_height);    /* try to detect the padding bug */    if(      s->codec_id==CODEC_ID_MPEG4       &&   (s->workaround_bugs&FF_BUG_AUTODETECT)        &&    s->gb.size*8 - get_bits_count(&s->gb) >=0       &&    s->gb.size*8 - get_bits_count(&s->gb) < 48       &&   !s->resync_marker       &&   !s->data_partitioning){                const int bits_count= get_bits_count(&s->gb);        const int bits_left = s->gb.size*8 - bits_count;                if(bits_left==0 || bits_left>8){            s->padding_bug_score++;        } else if(bits_left != 1){            int v= show_bits(&s->gb, 8);            v|= 0x7F >> (7-(bits_count&7));            if(v==0x7F)                s->padding_bug_score--;            else                s->padding_bug_score++;                    }                if(s->padding_bug_score > -2)            s->workaround_bugs |=  FF_BUG_NO_PADDING;        else            s->workaround_bugs &= ~FF_BUG_NO_PADDING;    }    // handle formats which dont have unique end markers    if(s->msmpeg4_version || (s->workaround_bugs&FF_BUG_NO_PADDING)){ //FIXME perhaps solve this more cleanly        int left= s->gb.size*8 - get_bits_count(&s->gb);        int max_extra=7;                /* no markers in M$ crap */        if(s->msmpeg4_version && s->pict_type==I_TYPE)            max_extra+= 17;                /* buggy padding but the frame should still end approximately at the bitstream end */        if((s->workaround_bugs&FF_BUG_NO_PADDING) && s->error_resilience>=3)            max_extra+= 48;        else if((s->workaround_bugs&FF_BUG_NO_PADDING))            max_extra+= 256*256*256*64;                if(left>max_extra){            fprintf(stderr, "discarding %d junk bits at end, next would be %X\n", left, show_bits(&s->gb, 24));        }        else if(left<0){            fprintf(stderr, "overreading %d bits\n", -left);        }else            s->error_status_table[s->mb_num-1]|= AC_END|MV_END|DC_END;                return 0;    }    fprintf(stderr, "slice end not reached but screenspace end (%d left %06X)\n",             s->gb.size*8 - get_bits_count(&s->gb),            show_bits(&s->gb, 24));    return -1;}