summaryrefslogtreecommitdiff
path: root/libavcodec/vp3.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-01-28 22:43:30 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-01-28 22:46:48 +0100
commit14c8ee00ffd9d45e6e0c6f11a957ce7e56f7eb3a (patch)
tree7e0702cfb87a0c26dcb52f46919178390fc3f547 /libavcodec/vp3.c
parent1336382c6d4d45e2c3513bf79f079349580a6db1 (diff)
vp3dec: move threads check out of header packet type check
Prevents reconfiguration with threads which is unsupported and would bring the contexts into an inconsistent state. Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/vp3.c')
-rw-r--r--libavcodec/vp3.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c
index 792dbb2a61..00a77e9e78 100644
--- a/libavcodec/vp3.c
+++ b/libavcodec/vp3.c
@@ -1928,11 +1928,11 @@ static int vp3_decode_frame(AVCodecContext *avctx,
int type = get_bits(&gb, 7);
skip_bits_long(&gb, 6*8); /* "theora" */
+ if (s->avctx->active_thread_type&FF_THREAD_FRAME) {
+ av_log(avctx, AV_LOG_ERROR, "midstream reconfiguration with multithreading is unsupported, try -threads 1\n");
+ return AVERROR_PATCHWELCOME;
+ }
if (type == 0) {
- if (s->avctx->active_thread_type&FF_THREAD_FRAME) {
- av_log(avctx, AV_LOG_ERROR, "midstream reconfiguration with multithreading is unsupported, try -threads 1\n");
- return AVERROR_PATCHWELCOME;
- }
vp3_decode_end(avctx);
ret = theora_decode_header(avctx, &gb);