Quoting Leo Izen (2022-04-15 03:37:20) > > On 4/14/22 13:49, Anton Khirnov wrote: > > Quoting Leo Izen (2022-04-12 07:53:32) > >> + > >> + while (1) { > >> + jret = JxlEncoderProcessOutput(ctx->encoder, &next_out, > >> &available); > >> + if (jret == JXL_ENC_ERROR) { > >> + av_log(avctx, AV_LOG_ERROR, "Unspecified libjxl error > >> occurred\n"); > >> + return AVERROR_EXTERNAL; > >> + } > >> + bytes_written = ctx->buffer_size - available; > >> + /* all data passed has been encoded */ > >> + if (jret == JXL_ENC_SUCCESS) > >> + break; > >> + if (jret == JXL_ENC_NEED_MORE_OUTPUT) { > > Is it possible for the encoder to return anything other than the three > > codes you're handling? Won't you get into an infinite loop if it does? > > > It's just these three, according to the documentation. > https://libjxl.readthedocs.io/en/latest/api_encoder.html
So the end of the loop should be unreachable, as you always break, continue or return before. I would put return AVERROR_EXTERNAL there just in case. Beyond that I have no more comments on the set. -- Anton Khirnov _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".