From 28263f5f15e1acededd06128f1bd75e0112b00c2 Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Sat, 28 Jul 2007 18:02:19 +0000 Subject: [PATCH] Fix get_str/get_str8() to also work if the target string is not long enough to fit all data from the container string, and allow NULL as a string also to simply skip the string altogether. patch by Ronald S. Bultje, rsbultje gmail com Originally committed as revision 9817 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavformat/rmdec.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c index 7f73416292..d2e8ea2f42 100644 --- a/libavformat/rmdec.c +++ b/libavformat/rmdec.c @@ -25,29 +25,31 @@ static void get_str(ByteIOContext *pb, char *buf, int buf_size) { int len, i; - char *q; + char *q, r; len = get_be16(pb); q = buf; for(i=0;i 0) *q = '\0'; } static void get_str8(ByteIOContext *pb, char *buf, int buf_size) { int len, i; - char *q; + char *q, r; len = get_byte(pb); q = buf; for(i=0;i 0) *q = '\0'; } static int rm_read_audio_stream_info(AVFormatContext *s, AVStream *st,