summaryrefslogtreecommitdiff
path: root/libavformat/flvdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2006-12-10 17:31:17 +0000
committerMichael Niedermayer <michaelni@gmx.at>2006-12-10 17:31:17 +0000
commit896bcd2e85fce1c6fdf051136960819b37ece2b9 (patch)
tree25a35d2f34cb6ec6ded83b144c6f68fa202a6db4 /libavformat/flvdec.c
parent4eb0c665050236f77681ccf2ef36ee6ea943b814 (diff)
amf_get_string() by Allan Hsu allan aat counterpop doot net
Originally committed as revision 7269 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/flvdec.c')
-rw-r--r--libavformat/flvdec.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index 18b627b80e..a137698113 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -40,6 +40,22 @@ static int flv_probe(AVProbeData *p)
return 0;
}
+static int amf_get_string(ByteIOContext *ioc, char *buffer, int buffsize) {
+ int length;
+
+ length = get_be16(ioc);
+ if(length >= buffsize) {
+ url_fskip(ioc, length);
+ return -1; //string will not fit in buffer
+ }
+
+ get_buffer(ioc, buffer, length);
+
+ buffer[length] = '\0';
+
+ return length;
+}
+
static int flv_read_header(AVFormatContext *s,
AVFormatParameters *ap)
{