Revision d6136c76

View differences:

libavcodec/xsubdec.c
24 24
    return ms;
25 25
}
26 26

  
27
static const uint8_t runbits[8] = { 14, 14, 10, 10, 6, 6, 2, 2 };
28

  
29 27
static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
30 28
                        uint8_t *buf, int buf_size) {
31 29
    AVSubtitle *sub = data;
......
85 83
    for (y = 0; y < h; y++) {
86 84
        for (x = 0; x < w; ) {
87 85
            int log2 = ff_log2_tab[show_bits(&gb, 8)];
88
            int run = get_bits(&gb, runbits[log2]);
86
            int run = get_bits(&gb, 14 - 4 * (log2 >> 1));
89 87
            int colour = get_bits(&gb, 2);
90 88
            run = FFMIN(run, w - x);
91 89
            // run length 0 means till end of row

Also available in: Unified diff