Revision 4bb789ed Chunkiser/input-avs.c

View differences:

Chunkiser/input-avs.c
77 77
        if (res >= 0) {
78 78
            st = s->streams[pkt.stream_index];
79 79
            if (pkt.flags & PKT_FLAG_KEY) {
80
                c->data = static_buff;
81 80
                c->size = p - static_buff;
81
                c->data = malloc(c->size);
82
                if (c->data == NULL) {
83
                  return 0;
84
                }
85
                memcpy(c->data, static_buff, c->size);
86
                c->attributes_size = 0;
87
                c->attributes = NULL;
82 88
                c->id = cid++; 
83 89
                return 1;
84 90
            }
......
86 92
            p += pkt.size;
87 93
        } else {
88 94
            if (p - static_buff > 0) {
89
                c->data = static_buff;
90 95
                c->size = p - static_buff;
96
                c->data = malloc(c->size);
97
                if (c->data == NULL) {
98
                  return 0;
99
                }
100
                memcpy(c->data, static_buff, c->size);
101
                c->attributes_size = 0;
102
                c->attributes = NULL;
91 103
                c->id = cid++; 
92 104
                return 1;
93 105
            }

Also available in: Unified diff