[FFmpeg-devel] [PATCH] seek_print: Check stream index
Michael Niedermayer
michaelni at gmx.at
Tue Mar 19 13:41:43 CET 2013
Fixes CID991858
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
---
tools/seek_print.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tools/seek_print.c b/tools/seek_print.c
index a99a0ad..a6e9466 100644
--- a/tools/seek_print.c
+++ b/tools/seek_print.c
@@ -93,6 +93,10 @@ int main(int argc, char **argv)
}
} else if (sscanf(*argv, "seek:%i:%"PRIi64":%"PRIi64":%"PRIi64":%i",
&stream, &min_ts, &ts, &max_ts, &flags) == 5) {
+ if (stream < -1 || stream >= avf->nb_streams) {
+ fprintf(stderr, "Invalid stream index %d\n", stream);
+ return 1;
+ }
ret = avformat_seek_file(avf, stream, min_ts, ts, max_ts, flags);
printf("seek: %d (%s)\n", ret, av_err2str(ret));
} else {
--
1.7.9.5
More information about the ffmpeg-devel
mailing list