aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/vp3.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2005-03-03 02:24:20 +0000
committerMichael Niedermayer <michaelni@gmx.at>2005-03-03 02:24:20 +0000
commitee89b2b9e77371d65d72ddd2b83f37cc0658c479 (patch)
treebfe92f928317a29233d515f77a0b9abb0f8650f5 /libavcodec/vp3.c
parentf86f4481d87101a9a621e5ee7952e1ff15ea364c (diff)
downloadffmpeg-ee89b2b9e77371d65d72ddd2b83f37cc0658c479.tar.gz
04-vp3 fix(by matthieu castet).patch
Originally committed as revision 3998 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/vp3.c')
-rw-r--r--libavcodec/vp3.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c
index 8b12a3c539..659d6913bb 100644
--- a/libavcodec/vp3.c
+++ b/libavcodec/vp3.c
@@ -2919,13 +2919,20 @@ static int theora_decode_init(AVCodecContext *avctx)
Vp3DecodeContext *s = avctx->priv_data;
GetBitContext gb;
int ptype;
+ uint8_t *p= avctx->extradata;
+ int op_bytes, i;
s->theora = 1;
if (!avctx->extradata_size)
return -1;
- init_get_bits(&gb, avctx->extradata, avctx->extradata_size);
+ for(i=0;i<3;i++) {
+ op_bytes = *(p++)<<8;
+ op_bytes += *(p++);
+
+ init_get_bits(&gb, p, op_bytes);
+ p += op_bytes;
ptype = get_bits(&gb, 8);
debug_vp3("Theora headerpacket type: %x\n", ptype);
@@ -2948,6 +2955,7 @@ static int theora_decode_init(AVCodecContext *avctx)
theora_decode_tables(avctx, gb);
break;
}
+ }
return 0;
}