[FFmpeg-cvslog] ffprobe: fix uninitialized variable warning

Stefano Sabatini git at videolan.org
Mon Sep 23 14:17:42 CEST 2013


ffmpeg | branch: master | Stefano Sabatini <stefasab at gmail.com> | Mon Sep 23 14:10:52 2013 +0200| [7bac6e5cf81b1f956f06d15546a376e32f4ea558] | committer: Stefano Sabatini

ffprobe: fix uninitialized variable warning

Fix warning:
ffprobe.c:1684:21: warning: ‘start’ may be used uninitialized in this function [-Wmaybe-uninitialized] end = start + interval->end;

The warning is a false positive, since the variable is accessed only if
has_start is set, and in that case start has been already set.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7bac6e5cf81b1f956f06d15546a376e32f4ea558
---

 ffprobe.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ffprobe.c b/ffprobe.c
index bbcdc97..8b1a584 100644
--- a/ffprobe.c
+++ b/ffprobe.c
@@ -1636,7 +1636,7 @@ static int read_interval_packets(WriterContext *w, AVFormatContext *fmt_ctx,
     AVPacket pkt, pkt1;
     AVFrame frame;
     int ret = 0, i = 0, frame_count = 0;
-    int64_t start, end = interval->end;
+    int64_t start = -INT64_MAX, end = interval->end;
     int has_start = 0, has_end = interval->has_end && !interval->end_is_offset;
 
     av_init_packet(&pkt);



More information about the ffmpeg-cvslog mailing list