Revision 9f449d57 libavformat/c93.c

View differences:

libavformat/c93.c
21 21

  
22 22
#include "avformat.h"
23 23
#include "voc.h"
24
#include "libavutil/intreadwrite.h"
24 25

  
25 26
typedef struct {
26 27
    uint16_t index;
......
43 44

  
44 45
static int probe(AVProbeData *p)
45 46
{
46
    if (p->buf[0] == 0x01 && p->buf[1] == 0x00 &&
47
        p->buf[4] == 0x01 + p->buf[2] &&
48
        p->buf[8] == p->buf[4] + p->buf[6] &&
49
        p->buf[12] == p->buf[8] + p->buf[10])
50
        return AVPROBE_SCORE_MAX;
51

  
52
    return 0;
47
    int i;
48
    int index = 1;
49
    if (p->buf_size < 16)
50
        return 0;
51
    for (i = 0; i < 16; i += 4) {
52
        if (AV_RL16(p->buf + i) != index || !p->buf[i + 2] || !p->buf[i + 3])
53
            return 0;
54
        index += p->buf[i + 2];
55
    }
56
    return AVPROBE_SCORE_MAX;
53 57
}
54 58

  
55 59
static int read_header(AVFormatContext *s,

Also available in: Unified diff