[FFmpeg-cvslog] theora: Skip zero-sized headers

Martin Storsjö git at videolan.org
Sat Jan 19 16:16:12 CET 2013


ffmpeg | branch: release/1.1 | Martin Storsjö <martin at martin.st> | Thu Jan 17 16:03:36 2013 +0200| [c749bec8c3ef88e3e12847a60d6e8e6d73c736d4] | committer: Martin Storsjö

theora: Skip zero-sized headers

This fixes a regression since d9cf5f51/7a2ee770f5 with theora
over RTP (possibly with other variants of theora as well).

In theora over RTP, the second of the 3 headers turns out to be
0 bytes long, which prior to d9cf5f51 worked just fine. After
d9cf5f51, reading from the bitstream reader fails (since the reader
wasn't initialized but returned an error if initialized with 0 bits).

CC: libav-stable at libav.org
Signed-off-by: Martin Storsjö <martin at martin.st>
(cherry picked from commit e33db35b4a91ad543d9dde3a981a89118ba68937)

Signed-off-by: Martin Storsjö <martin at martin.st>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c749bec8c3ef88e3e12847a60d6e8e6d73c736d4
---

 libavcodec/vp3.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c
index bdd4289..0340c22 100644
--- a/libavcodec/vp3.c
+++ b/libavcodec/vp3.c
@@ -2339,6 +2339,8 @@ static av_cold int theora_decode_init(AVCodecContext *avctx)
     }
 
   for(i=0;i<3;i++) {
+    if (header_len[i] <= 0)
+        continue;
     init_get_bits(&gb, header_start[i], header_len[i] * 8);
 
     ptype = get_bits(&gb, 8);



More information about the ffmpeg-cvslog mailing list