From 4d445316e2997f0fc68a9b56086287dbe835d114 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Sun, 26 Feb 2017 23:37:22 +0100 Subject: [PATCH] src/io/source_avcodec.c: make sure seek position is >= 0 --- src/io/source_avcodec.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/io/source_avcodec.c b/src/io/source_avcodec.c index 4f9e25cd..4ed64993 100644 --- a/src/io/source_avcodec.c +++ b/src/io/source_avcodec.c @@ -484,6 +484,11 @@ uint_t aubio_source_avcodec_seek (aubio_source_avcodec_t * s, uint_t pos) { AUBIO_ERR("source_avcodec: failed seeking in %s (file not opened?)", s->path); return ret; } + if ((sint_t)pos < 0) { + AUBIO_ERR("source_avcodec: could not seek %s at %d (seeking position" + " should be >= 0)\n", s->path, pos); + return AUBIO_FAIL; + } ret = avformat_seek_file(s->avFormatCtx, s->selected_stream, min_ts, resampled_pos, max_ts, seek_flags); if (ret < 0) { -- 2.11.0