shithub: aubio

Download patch

ref: 4d445316e2997f0fc68a9b56086287dbe835d114
parent: 41b44211e957254333d2d6d0eddf7c06d416ed7f
author: Paul Brossier <piem@piem.org>
date: Sun Feb 26 18:37:22 EST 2017

src/io/source_avcodec.c: make sure seek position is >= 0

--- a/src/io/source_avcodec.c
+++ b/src/io/source_avcodec.c
@@ -484,6 +484,11 @@
     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) {