diff --git a/libavcodec/vble.c b/libavcodec/vble.c index 4511433a6c..c48feb9a59 100644 --- a/libavcodec/vble.c +++ b/libavcodec/vble.c @@ -130,10 +130,6 @@ static int vble_decode_frame(AVCodecContext *avctx, AVFrame *pic, return AVERROR_INVALIDDATA; } - /* Allocate buffer */ - if ((ret = ff_thread_get_buffer(avctx, pic, 0)) < 0) - return ret; - /* Version should always be 1 */ version = AV_RL32(src); @@ -148,6 +144,10 @@ static int vble_decode_frame(AVCodecContext *avctx, AVFrame *pic, return AVERROR_INVALIDDATA; } + /* Allocate buffer */ + if ((ret = ff_thread_get_buffer(avctx, pic, 0)) < 0) + return ret; + /* Restore planes. Should be almost identical to Huffyuv's. */ vble_restore_plane(ctx, pic, &gb, 0, offset, avctx->width, avctx->height);