Message ID | 20220208182614.25504-1-anton@khirnov.net |
---|---|
State | Accepted |
Commit | e9acff8a013bdd6d459116ceb35f8a53b60ff521 |
Headers | show |
Series | [FFmpeg-devel,1/2] lavu/fifo: fix a corner case in av_fifo_grow2() | expand |
Context | Check | Description |
---|---|---|
andriy/make_x86 | success | Make finished |
andriy/make_fate_x86 | success | Make fate finished |
andriy/make_ppc | success | Make finished |
andriy/make_fate_ppc | success | Make fate finished |
diff --git a/libavutil/fifo.c b/libavutil/fifo.c index 0af0154945..2af8842cc5 100644 --- a/libavutil/fifo.c +++ b/libavutil/fifo.c @@ -115,7 +115,7 @@ int av_fifo_grow2(AVFifo *f, size_t inc) (f->offset_w - copy) * f->elem_size); f->offset_w -= copy; } else - f->offset_w = f->nb_elems + copy; + f->offset_w = copy == inc ? 0 : f->nb_elems + copy; } f->nb_elems += inc;