From 7d1de6215a4c92eb15690f7fcaa3902a293a30d2 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Wed, 23 Apr 2014 00:25:55 +0000 Subject: [PATCH] improve error recovery in lazy bdecoder --- src/lazy_bdecode.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lazy_bdecode.cpp b/src/lazy_bdecode.cpp index 665d5a673..eec257456 100644 --- a/src/lazy_bdecode.cpp +++ b/src/lazy_bdecode.cpp @@ -49,7 +49,10 @@ namespace libtorrent ec = make_error_code(code); \ while (!stack.empty()) { \ top = stack.back(); \ - if (top->type() == lazy_entry::dict_t || top->type() == lazy_entry::list_t) top->pop(); \ + if (top->type() == lazy_entry::dict_t || top->type() == lazy_entry::list_t) { \ + top->pop(); \ + break; \ + } \ stack.pop_back(); \ } \ if (error_pos) *error_pos = start - orig_start; \