[FFmpeg-devel] avformat/async: fix assertion condition when draining buffer

Submitted by Marton Balint on Jan. 27, 2019, 6:51 p.m.

Details

Message ID 20190127185146.31485-1-cus@passwd.hu
State New
Headers show

Commit Message

Marton Balint Jan. 27, 2019, 6:51 p.m.
Fixes some random assertion failures with

ffprobe -show_packets async:samples/ffmpeg-bugs/trac/ticket6132/Samsung_HDR_-_Chasing_the_Light.ts > /dev/null

Signed-off-by: Marton Balint <cus@passwd.hu>
---
 libavformat/async.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Marton Balint Feb. 4, 2019, 8:50 p.m.
On Sun, 27 Jan 2019, Marton Balint wrote:

> Fixes some random assertion failures with
>
> ffprobe -show_packets async:samples/ffmpeg-bugs/trac/ticket6132/Samsung_HDR_-_Chasing_the_Light.ts > /dev/null
>
> Signed-off-by: Marton Balint <cus@passwd.hu>
> ---
> libavformat/async.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavformat/async.c b/libavformat/async.c
> index 54dbd2312a..4e295b5e10 100644
> --- a/libavformat/async.c
> +++ b/libavformat/async.c
> @@ -142,7 +142,7 @@ static int ring_size_of_read_back(RingBuffer *ring)
> static int ring_drain(RingBuffer *ring, int offset)
> {
>     av_assert2(offset >= -ring_size_of_read_back(ring));
> -    av_assert2(offset <= -ring_size(ring));
> +    av_assert2(offset <= ring_size(ring));
>     ring->read_pos += offset;
>     return 0;
> }

Pushed.

Regards,
Marton

Patch hide | download patch | download mbox

diff --git a/libavformat/async.c b/libavformat/async.c
index 54dbd2312a..4e295b5e10 100644
--- a/libavformat/async.c
+++ b/libavformat/async.c
@@ -142,7 +142,7 @@  static int ring_size_of_read_back(RingBuffer *ring)
 static int ring_drain(RingBuffer *ring, int offset)
 {
     av_assert2(offset >= -ring_size_of_read_back(ring));
-    av_assert2(offset <= -ring_size(ring));
+    av_assert2(offset <= ring_size(ring));
     ring->read_pos += offset;
     return 0;
 }