Commit e7389ed5 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit 'bcc94328'

* commit 'bcc94328':
  opt: check the return values of av_get_token for ENOMEM.
  doc: Fix best_nb_channells typo
  matroska: pass the lace size to the matroska_parse_rm_audio

Conflicts:
	libavformat/matroskadec.c
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 534b2921 bcc94328
...@@ -79,7 +79,7 @@ static int select_channel_layout(AVCodec *codec) ...@@ -79,7 +79,7 @@ static int select_channel_layout(AVCodec *codec)
{ {
const uint64_t *p; const uint64_t *p;
uint64_t best_ch_layout = 0; uint64_t best_ch_layout = 0;
int best_nb_channells = 0; int best_nb_channels = 0;
if (!codec->channel_layouts) if (!codec->channel_layouts)
return AV_CH_LAYOUT_STEREO; return AV_CH_LAYOUT_STEREO;
...@@ -88,9 +88,9 @@ static int select_channel_layout(AVCodec *codec) ...@@ -88,9 +88,9 @@ static int select_channel_layout(AVCodec *codec)
while (*p) { while (*p) {
int nb_channels = av_get_channel_layout_nb_channels(*p); int nb_channels = av_get_channel_layout_nb_channels(*p);
if (nb_channels > best_nb_channells) { if (nb_channels > best_nb_channels) {
best_ch_layout = *p; best_ch_layout = *p;
best_nb_channells = nb_channels; best_nb_channels = nb_channels;
} }
p++; p++;
} }
......
...@@ -2327,7 +2327,8 @@ static int matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data, ...@@ -2327,7 +2327,8 @@ static int matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data,
st->codec->codec_id == AV_CODEC_ID_ATRAC3) && st->codec->codec_id == AV_CODEC_ID_ATRAC3) &&
st->codec->block_align && track->audio.sub_packet_size) { st->codec->block_align && track->audio.sub_packet_size) {
res = matroska_parse_rm_audio(matroska, track, st, data, size, res = matroska_parse_rm_audio(matroska, track, st, data,
lace_size[n],
timecode, pos); timecode, pos);
if (res) if (res)
goto end; goto end;
......
...@@ -1032,9 +1032,16 @@ static int parse_key_value_pair(void *ctx, const char **buf, ...@@ -1032,9 +1032,16 @@ static int parse_key_value_pair(void *ctx, const char **buf,
char *val; char *val;
int ret; int ret;
if (!key)
return AVERROR(ENOMEM);
if (*key && strspn(*buf, key_val_sep)) { if (*key && strspn(*buf, key_val_sep)) {
(*buf)++; (*buf)++;
val = av_get_token(buf, pairs_sep); val = av_get_token(buf, pairs_sep);
if (!val) {
av_freep(&key);
return AVERROR(ENOMEM);
}
} else { } else {
av_log(ctx, AV_LOG_ERROR, "Missing key or no key/value separator found after key '%s'\n", key); av_log(ctx, AV_LOG_ERROR, "Missing key or no key/value separator found after key '%s'\n", key);
av_free(key); av_free(key);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment