+ av_log(s, AV_LOG_INFO, "Compressed SWF file detected\n");
+#if CONFIG_ZLIB
+ if (inflateInit(&swf->zstream) != Z_OK) {
+ av_log(s, AV_LOG_ERROR, "Unable to init zlib context\n");
+ return AVERROR(EINVAL);
+ }
+ swf->zbuf_in = av_malloc(ZBUF_SIZE);
+ swf->zbuf_out = av_malloc(ZBUF_SIZE);
+ swf->zpb = avio_alloc_context(swf->zbuf_out, ZBUF_SIZE, 0, s,
+ zlib_refill, NULL, NULL);
+ if (!swf->zbuf_in || !swf->zbuf_out || !swf->zpb) {
+ av_freep(&swf->zbuf_in);
+ av_freep(&swf->zbuf_out);
+ av_freep(&swf->zpb);
+ return AVERROR(ENOMEM);
+ }
+ swf->zpb->seekable = 0;
+ pb = swf->zpb;
+#else
+ av_log(s, AV_LOG_ERROR, "missing zlib support, unable to open\n");