summaryrefslogtreecommitdiff
path: root/libavcodec/h261dec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-08-15 02:41:43 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-08-15 02:41:47 +0200
commit595c63357cdc4e08a36971f2aae0fb1f019e7224 (patch)
tree08e2697d9f25cb1fa72950e974cfc3d42b982527 /libavcodec/h261dec.c
parent012062cfd51f50862d18eeb35e316866932cfd0e (diff)
parent552bc42df48784ae3ce0d499ece5b33f3cc7576a (diff)
downloadffmpeg-595c63357cdc4e08a36971f2aae0fb1f019e7224.tar.gz
Merge commit '552bc42df48784ae3ce0d499ece5b33f3cc7576a'
* commit '552bc42df48784ae3ce0d499ece5b33f3cc7576a': h261dec: Fix order of initialization Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/h261dec.c')
-rw-r--r--libavcodec/h261dec.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/libavcodec/h261dec.c b/libavcodec/h261dec.c
index 9c46f2de23..dea554b71c 100644
--- a/libavcodec/h261dec.c
+++ b/libavcodec/h261dec.c
@@ -590,12 +590,9 @@ static int h261_decode_frame(AVCodecContext *avctx, void *data,
retry:
init_get_bits(&s->gb, buf, buf_size * 8);
- if (!s->context_initialized) {
+ if (!s->context_initialized)
// we need the IDCT permutaton for reading a custom matrix
ff_mpv_idct_init(s);
- if (ff_MPV_common_init(s) < 0)
- return -1;
- }
ret = h261_decode_picture_header(h);
@@ -611,6 +608,11 @@ retry:
ff_MPV_common_end(s);
s->parse_context = pc;
}
+
+ if (!s->context_initialized)
+ if ((ret = ff_MPV_common_init(s)) < 0)
+ return ret;
+
if (!s->context_initialized) {
ret = ff_set_dimensions(avctx, s->width, s->height);
if (ret < 0)