aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/alac.c
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2012-07-09 13:01:32 -0400
committerJustin Ruggles <justin.ruggles@gmail.com>2012-07-19 13:26:47 -0400
commit9a6c528e08c42f43216fed9d6abd9e545db88d13 (patch)
tree3aa724027a67f42dd3b8a5a4796decd71fbe7eca /libavcodec/alac.c
parentebd4c3add1ecad2c65ac80f0787ca5c1e78b600e (diff)
downloadffmpeg-9a6c528e08c42f43216fed9d6abd9e545db88d13.tar.gz
alac: factor out output_size check in predictor_decompress_fir_adapt()
Diffstat (limited to 'libavcodec/alac.c')
-rw-r--r--libavcodec/alac.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/libavcodec/alac.c b/libavcodec/alac.c
index 42dfdad595..474531b83e 100644
--- a/libavcodec/alac.c
+++ b/libavcodec/alac.c
@@ -173,10 +173,10 @@ static void predictor_decompress_fir_adapt(int32_t *error_buffer,
/* first sample always copies */
*buffer_out = *error_buffer;
- if (!predictor_coef_num) {
- if (output_size <= 1)
- return;
+ if (output_size <= 1)
+ return;
+ if (!predictor_coef_num) {
memcpy(&buffer_out[1], &error_buffer[1],
(output_size - 1) * sizeof(*buffer_out));
return;
@@ -184,8 +184,6 @@ static void predictor_decompress_fir_adapt(int32_t *error_buffer,
if (predictor_coef_num == 31) {
/* simple 1st-order prediction */
- if (output_size <= 1)
- return;
for (i = 1; i < output_size; i++) {
buffer_out[i] = sign_extend(buffer_out[i - 1] + error_buffer[i],
readsamplesize);