summaryrefslogtreecommitdiff
path: root/libavcodec/mlpdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-07-12 13:25:28 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-07-12 13:28:40 +0200
commite9348e107bafcf0106c52f582d70fa53716b4ac4 (patch)
tree7979a4ce08e622100a1fe345a2a9a199b4d3786c /libavcodec/mlpdec.c
parent9d47333e3eee1d9a31a98ebf67338463943846dc (diff)
parente9d394f3fad7e8fd8fc80e3b33cb045bbaceb446 (diff)
Merge commit 'e9d394f3fad7e8fd8fc80e3b33cb045bbaceb446'
* commit 'e9d394f3fad7e8fd8fc80e3b33cb045bbaceb446': mlpdec: Do not set invalid context in read_restart_header Conflicts: libavcodec/mlpdec.c See: a9cd12ee2afb3f3aad783c396816b23d8513f472 Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/mlpdec.c')
-rw-r--r--libavcodec/mlpdec.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/libavcodec/mlpdec.c b/libavcodec/mlpdec.c
index a4d53780f1..610cfece21 100644
--- a/libavcodec/mlpdec.c
+++ b/libavcodec/mlpdec.c
@@ -401,10 +401,10 @@ static int read_restart_header(MLPDecodeContext *m, GetBitContext *gbp,
uint8_t checksum;
uint8_t lossless_check;
int start_count = get_bits_count(gbp);
- const int max_matrix_channel = m->avctx->codec_id == AV_CODEC_ID_MLP
- ? MAX_MATRIX_CHANNEL_MLP
- : MAX_MATRIX_CHANNEL_TRUEHD;
- int max_channel, min_channel, matrix_channel;
+ int min_channel, max_channel, max_matrix_channel;
+ const int std_max_matrix_channel = m->avctx->codec_id == AV_CODEC_ID_MLP
+ ? MAX_MATRIX_CHANNEL_MLP
+ : MAX_MATRIX_CHANNEL_TRUEHD;
sync_word = get_bits(gbp, 13);
@@ -423,18 +423,18 @@ static int read_restart_header(MLPDecodeContext *m, GetBitContext *gbp,
skip_bits(gbp, 16); /* Output timestamp */
- min_channel = get_bits(gbp, 4);
- max_channel = get_bits(gbp, 4);
- matrix_channel = get_bits(gbp, 4);
+ min_channel = get_bits(gbp, 4);
+ max_channel = get_bits(gbp, 4);
+ max_matrix_channel = get_bits(gbp, 4);
- if (matrix_channel > max_matrix_channel) {
+ if (max_matrix_channel > std_max_matrix_channel) {
av_log(m->avctx, AV_LOG_ERROR,
"Max matrix channel cannot be greater than %d.\n",
- max_matrix_channel);
+ std_max_matrix_channel);
return AVERROR_INVALIDDATA;
}
- if (max_channel != matrix_channel) {
+ if (max_channel != max_matrix_channel) {
av_log(m->avctx, AV_LOG_ERROR,
"Max channel must be equal max matrix channel.\n");
return AVERROR_INVALIDDATA;
@@ -456,9 +456,9 @@ static int read_restart_header(MLPDecodeContext *m, GetBitContext *gbp,
return AVERROR_INVALIDDATA;
}
- s->min_channel = min_channel;
- s->max_channel = max_channel;
- s->max_matrix_channel = matrix_channel;
+ s->min_channel = min_channel;
+ s->max_channel = max_channel;
+ s->max_matrix_channel = max_matrix_channel;
#if FF_API_REQUEST_CHANNELS
if (m->avctx->request_channels > 0 &&