*/
#include "avformat.h"
#include "rm.h"
-
+#include "avstring.h"
static void get_str(ByteIOContext *pb, char *buf, int buf_size)
{
}
} else {
st->codec->codec_id = CODEC_ID_NONE;
- pstrcpy(st->codec->codec_name, sizeof(st->codec->codec_name),
- buf);
+ av_strlcpy(st->codec->codec_name, buf, sizeof(st->codec->codec_name));
}
if (read_all) {
get_byte(pb);
RMContext *rm = s->priv_data;
ByteIOContext *pb = &s->pb;
AVStream *st;
- int i, len, tmp, j;
+ int i, len, j;
int64_t timestamp, pos;
uint8_t *ptr;
int flags;
/* for AC3, needs to swap bytes */
if (st->codec->codec_id == CODEC_ID_AC3) {
ptr = pkt->data;
- for(j=0;j<len;j+=2) {
- tmp = ptr[0];
- ptr[0] = ptr[1];
- ptr[1] = tmp;
+ for(j=0;j<pkt->size;j+=2) {
+ FFSWAP(int, ptr[0], ptr[1]);
ptr += 2;
}
}