st->codec->height = height;
/* load up the Huffman tables into extradata */
- st->codec->extradata = av_malloc(HUFFMAN_TABLE_SIZE);
- if (!st->codec->extradata)
+ if (ff_alloc_extradata(st->codec, HUFFMAN_TABLE_SIZE))
return AVERROR(ENOMEM);
- st->codec->extradata_size = HUFFMAN_TABLE_SIZE;
ret = avio_read(pb, st->codec->extradata, HUFFMAN_TABLE_SIZE);
if (ret < 0) {
return ret;