[FFmpeg-devel] [PATCH 2/2] fftools/resman: use inflate loop with increasing buffer size

Kieran Kunhya kieran618 at googlemail.com
Sat May 31 05:38:33 EEST 2025


>
>         }
> +
> +        if (strm.avail_out == 0) {
> +            chunk *= 8;
>


*8 seems high

+            uint8_t *tmp_buf = av_realloc(buf, chunk + 1);
> +            if (!tmp_buf) {
> +                inflateEnd(&strm);
> +                av_free(buf);
> +                return AVERROR(ENOMEM);
> +            }
> +
> +            buf = tmp_buf;
> +        }
> +    } while (ret != Z_STREAM_END);
>
>      *out_len = chunk - strm.avail_out;
>      buf[*out_len] = 0; // Ensure null termination
> --
> ffmpeg-codebot
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".
>


More information about the ffmpeg-devel mailing list