af_asyncts: avoid overflow in out_size with large delta values
authorJustin Ruggles <justin.ruggles@gmail.com>
Sat, 28 Jul 2012 17:12:38 +0000 (13:12 -0400)
committerJustin Ruggles <justin.ruggles@gmail.com>
Sun, 29 Jul 2012 18:31:54 +0000 (14:31 -0400)
libavfilter/af_asyncts.c

index 5a12a6f..21850dd 100644 (file)
@@ -186,7 +186,7 @@ static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *buf)
 
     if (labs(delta) > s->min_delta) {
         av_log(ctx, AV_LOG_VERBOSE, "Discontinuity - %"PRId64" samples.\n", delta);
-        out_size += delta;
+        out_size = av_clipl_int32((int64_t)out_size + delta);
     } else {
         if (s->resample) {
             int comp = av_clip(delta, -s->max_comp, s->max_comp);