[XviD-devel] create.zones never freed after XVID_ENC_CREATE in VFW
Bryan Mayland
bmayland at leoninedev.com
Wed Jun 16 15:25:59 CEST 2004
Was reading through the VFW source (to port the zones implementation to
transcode) and I've noticed that the zones array passed in during
XVID_ENC_CREATE is never freed:
/vfw/src/codec.c:518
create.zones = malloc(sizeof(xvid_enc_zone_t) * tmpCfg.num_zones);
These zone structs are passed to xvid_encore_func() on line 576. XViD
will malloc its own memory and copy them from passed create struct.
Therefore they should be freed upon return. Easiest fix:
i = codec->xvid_encore_func(0, XVID_ENC_CREATE, &create, NULL);
free(create.zones);
create.zones = NULL;
switch(i)
...
Pretty minor, but thought I'd point it out.
Bry
More information about the XviD-devel
mailing list