Revision 69bde0b2

View differences:

libavformat/avidec.c
490 490
            return size;
491 491
          }
492 492
        }
493
        /* palette changed chunk */
494
        if (   d[0] >= '0' && d[0] <= '9'
495
            && d[1] >= '0' && d[1] <= '9'
496
            && ((d[2] == 'p' && d[3] == 'c'))
497
            && n < s->nb_streams && i + size <= avi->movi_end) {
498

  
499
            AVStream *st;
500
            int first, clr, flags, k, p;
501

  
502
            st = s->streams[n];
503

  
504
            first = get_byte(pb);
505
            clr = get_byte(pb);
506
            flags = get_le16(pb);
507
            p = 4;
508
            for (k = first; k < clr + first; k++) {
509
                int r, g, b;
510
                r = get_byte(pb);
511
                g = get_byte(pb);
512
                b = get_byte(pb);
513
                    get_byte(pb);
514
                st->codec.palctrl->palette[k] = b + (g << 8) + (r << 16);
515
            }
516
            st->codec.palctrl->palette_changed = 1;
517
        }
518

  
493 519
    }
494 520

  
495 521
    return -1;

Also available in: Unified diff