avdevice/v4l2: fix mmap_free() skipping first buffer

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
This commit is contained in:
Zhao Zhili
2026-04-13 21:16:07 +08:00
committed by Zhao Zhili
parent beb315ca31
commit 603234f945

View File

@@ -362,9 +362,8 @@ static void list_standards(AVFormatContext *ctx)
static void mmap_free(struct video_data *s, int n)
{
while (--n > 0) {
v4l2_munmap(s->buf_data[n].start, s->buf_data[n].len);
}
for (int i = 0; i < n; i++)
v4l2_munmap(s->buf_data[i].start, s->buf_data[i].len);
av_freep(&s->buf_data);
}