mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-11-21 10:55:51 +02:00
pthread: don't increment index on zero-sized packets.
The next call to decode() will update from an invalid index, which will either lead to a memcpy() where dest==src (2 threads), or lead to a crash (>2 threads). Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
This commit is contained in:
parent
ac47e014bb
commit
39a7a5b8ab
@ -491,6 +491,7 @@ static int submit_packet(PerThreadContext *p, AVPacket *avpkt)
|
||||
}
|
||||
|
||||
fctx->prev_thread = p;
|
||||
fctx->next_decoding++;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -513,8 +514,6 @@ int ff_thread_decode_frame(AVCodecContext *avctx,
|
||||
err = submit_packet(p, avpkt);
|
||||
if (err) return err;
|
||||
|
||||
fctx->next_decoding++;
|
||||
|
||||
/*
|
||||
* If we're still receiving the initial packets, don't return a frame.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user