[FFmpeg-devel] [PATCH] avformat/dhav: Do not evaluate avio_size() multiple times
Derek Buitenhuis
derek.buitenhuis at gmail.com
Sat Jun 7 19:23:26 EEST 2025
On 6/7/2025 12:12 AM, Michael Niedermayer wrote:
> Code like FFMIN(MAX_DURATION_BUFFER_SIZE, avio_size(s->pb)) is not safe
> as FFMIN() is a macro and avio_size() is thus evaluated multiple
> times
>
> CC: Justin Ruggles <justinr at vimeo.com>
> Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> ---
> libavformat/dhav.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
LGTM.
I don't think it is "not safe", just unexpected, though.
- Derek
More information about the ffmpeg-devel
mailing list