[Ffmpeg-cvslog] CVS: ffmpeg/libavformat rm.c,1.52,1.53
Roberto Togni CVS
rtognimp
Mon Dec 19 21:49:03 CET 2005
Update of /cvsroot/ffmpeg/ffmpeg/libavformat
In directory mail:/var2/tmp/cvs-serv24947
Modified Files:
rm.c
Log Message:
Fix for Real "old" files version 3 with no 4cc. Fixes thankyou144.ra
Based on patch by "mkhodor7 <-> yahoo | com"
Index: rm.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/rm.c,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -d -r1.52 -r1.53
--- rm.c 17 Dec 2005 18:14:37 -0000 1.52
+++ rm.c 19 Dec 2005 20:49:00 -0000 1.53
@@ -488,13 +488,14 @@
{
RMContext *rm = s->priv_data;
ByteIOContext *pb = &s->pb;
- char buf[128];
+ char buf[256];
uint32_t version;
int i;
/* ra type header */
version = get_be32(pb); /* version */
if (((version >> 16) & 0xff) == 3) {
+ int64_t startpos = url_ftell(pb);
/* very old version */
for(i = 0; i < 14; i++)
get_byte(pb);
@@ -502,8 +503,14 @@
get_str8(pb, s->author, sizeof(s->author));
get_str8(pb, s->copyright, sizeof(s->copyright));
get_str8(pb, s->comment, sizeof(s->comment));
+ if ((startpos + (version & 0xffff)) >= url_ftell(pb) + 2) {
+ // fourcc (should always be "lpcJ")
get_byte(pb);
get_str8(pb, buf, sizeof(buf));
+ }
+ // Skip extra header crap (this should never happen)
+ if ((startpos + (version & 0xffff)) > url_ftell(pb))
+ url_fskip(pb, (version & 0xffff) + startpos - url_ftell(pb));
st->codec->sample_rate = 8000;
st->codec->channels = 1;
st->codec->codec_type = CODEC_TYPE_AUDIO;
More information about the ffmpeg-cvslog
mailing list