@@ -94,7 +94,6 @@ static int eightsvx_decode_frame(AVCodecContext *avctx, void *data,
9494
9595 /* decode and interleave the first packet */
9696 if (!esc -> samples && avpkt ) {
97- uint8_t * deinterleaved_samples , * p = NULL ;
9897 int packet_size = avpkt -> size ;
9998
10099 if (packet_size % avctx -> channels ) {
@@ -119,23 +118,17 @@ static int eightsvx_decode_frame(AVCodecContext *avctx, void *data,
119118 av_log (avctx , AV_LOG_ERROR , "packet size is too small\n" );
120119 return AVERROR (EINVAL );
121120 }
122- if (!(deinterleaved_samples = av_mallocz (n )))
123- return AVERROR (ENOMEM );
124- dst = p = deinterleaved_samples ;
125121
126122 /* the uncompressed starting value is contained in the first byte */
127- dst = deinterleaved_samples ;
123+ dst = esc -> samples ;
128124 for (i = 0 ; i < avctx -> channels ; i ++ ) {
129125 delta_decode (dst , buf + 1 , buf_size / avctx -> channels - 1 , buf [0 ], esc -> table );
130126 buf += buf_size / avctx -> channels ;
131127 dst += n / avctx -> channels - 1 ;
132128 }
133129 } else {
134- deinterleaved_samples = avpkt -> data ;
130+ memcpy ( esc -> samples , avpkt -> data , esc -> samples_size ) ;
135131 }
136-
137- memcpy (esc -> samples , deinterleaved_samples , esc -> samples_size );
138- av_freep (& p );
139132 }
140133
141134 /* get output buffer */
0 commit comments