From e9e12eed664dea694c8782bfa5ae4787fdfe11a2 Mon Sep 17 00:00:00 2001 From: Jesse Talavera Date: Sun, 2 Mar 2025 17:00:40 -0500 Subject: [PATCH] Move a variable declaration up to adhere to C89 rules --- camera/drivers/ffmpeg.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/camera/drivers/ffmpeg.c b/camera/drivers/ffmpeg.c index ed0b56d75a..036d4c0994 100644 --- a/camera/drivers/ffmpeg.c +++ b/camera/drivers/ffmpeg.c @@ -282,6 +282,7 @@ static bool ffmpeg_camera_start(void *data) AVDictionary *options = NULL; const AVDictionaryEntry *e = NULL; const AVDictionaryEntry prev; + int target_buffer_length = 0; if (ffmpeg->format_context) { // TODO: Check the actual format context, not just the pointer @@ -378,7 +379,7 @@ static bool ffmpeg_camera_start(void *data) ffmpeg->target_width = ffmpeg->requested_width ? ffmpeg->requested_width : (unsigned)ffmpeg->decoder_context->width; ffmpeg->target_height = ffmpeg->requested_height ? ffmpeg->requested_height : (unsigned)ffmpeg->decoder_context->height; - int target_buffer_length = av_image_alloc( + target_buffer_length = av_image_alloc( ffmpeg->target_planes, ffmpeg->target_linesizes, ffmpeg->target_width,