From 692ce2503e805bd95c1d9d0b40491a5b77fbb6f7 Mon Sep 17 00:00:00 2001 From: James Almer Date: Tue, 7 Jan 2025 16:08:11 -0300 Subject: [PATCH] avformat/flvdec: initialize ret in flv_read_packet() to AVERROR_BUG This will ensure any future goto leave that may be added doesn't accidentally forget to set ret to some proper value. Reviewed-by: Timo Rothenpieler Signed-off-by: James Almer --- libavformat/flvdec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c index 15494d26cd..7d56c3e403 100644 --- a/libavformat/flvdec.c +++ b/libavformat/flvdec.c @@ -1280,7 +1280,7 @@ static int flv_update_video_color_info(AVFormatContext *s, AVStream *st) static int flv_read_packet(AVFormatContext *s, AVPacket *pkt) { FLVContext *flv = s->priv_data; - int ret = 0, i, size, flags; + int ret = AVERROR_BUG, i, size, flags; int res = 0; enum FlvTagType type; int stream_type = -1; @@ -1795,6 +1795,7 @@ next_track: } } + ret = 0; leave: last = avio_rb32(s->pb); if (!flv->trust_datasize) {