On 3/23/22 11:08, Andreas Rheinhardt wrote:
+ temp = av_realloc(ctx->buffer, ctx->buffer_size); + if (!temp) { + av_freep(&ctx->buffer);If you free this, you will be in a scenario where ctx->buffer is NULL, yet ctx->buffer_size is > 0. This is inconsistent and might lead to crashs in JxlEncoderProcessOutput. So don't free this and only set buffer_size after the reallocation succeeded.
Does it matter what ctx->buffer_size is if ctx->buffer is NULL? On 3/23/22 11:08, Andreas Rheinhardt wrote:
Unnecessary: av_freep() resets ctx->buffer and resetting buffer_size is unnecessary.
Here, you claim that resetting buffer_size is unnecessary but above you insist it is necessary. I'm confused here.
Leo Izen (thebombzen) _______________________________________________ ffmpeg-devel mailing list [email protected] https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email [email protected] with subject "unsubscribe".
