swf->zpb->seekable = 0;
if (inflateInit(&swf->zstream) != Z_OK) {
av_log(s, AV_LOG_ERROR, "Unable to init zlib context\n");
+ av_freep(&swf->zbuf_in);
+ av_freep(&swf->zbuf_out);
return AVERROR(EINVAL);
}
pb = swf->zpb;
if (linesize * height > pkt->size) {
res = AVERROR_INVALIDDATA;
- av_packet_unref(pkt);
goto bitmap_end;
}
if ((res = av_new_packet(pkt, len)) < 0)
return res;
if (avio_read(pb, pkt->data, 4) != 4) {
- av_packet_unref(pkt);
return AVERROR_INVALIDDATA;
}
if (AV_RB32(pkt->data) == 0xffd8ffd9 ||
}
if (res != pkt->size) {
if (res < 0) {
- av_packet_unref(pkt);
return res;
}
av_shrink_packet(pkt, res);