summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorDale Curtis <dalecurtis@chromium.org>2012-04-12 17:12:27 -0700
committerMichael Niedermayer <michaelni@gmx.at>2012-04-13 11:10:38 +0200
commita9d114dc8a24ae439fa6a2fe5eb1bfc346a0ad4a (patch)
tree236d18e56423778d3b82cd6737e006025d4dfff5 /libavcodec
parente9dc616472081f13827dbb19999f515abb61f3ae (diff)
pthread: Fix crash due to fctx->delaying not being cleared.
corrects invalid return when avpkt->size == 0. Reproducible with test case and ffplay -threads 2. Stack trace: http://pastebin.com/PexZ4Uc0 Test case: http://commondatastorage.googleapis.com/dalecurtis-shared/crash.ogm Signed-off-by: Dale Curtis <dalecurtis@chromium.org> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/pthread.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/pthread.c b/libavcodec/pthread.c
index c23098fbf5..79abd26eb6 100644
--- a/libavcodec/pthread.c
+++ b/libavcodec/pthread.c
@@ -614,11 +614,12 @@ int ff_thread_decode_frame(AVCodecContext *avctx,
* If we're still receiving the initial packets, don't return a frame.
*/
- if (fctx->delaying && avpkt->size) {
+ if (fctx->delaying) {
if (fctx->next_decoding >= (avctx->thread_count-1)) fctx->delaying = 0;
*got_picture_ptr=0;
- return avpkt->size;
+ if (avpkt->size)
+ return avpkt->size;
}
/*