Re: [libav-devel] [PATCH 2/3] ape: provide two additional bytes in buffer for old MAC versions

2013-03-13 Thread Tim W.
On Mar 13, 2013, at 6:25 AM, Kostya Shishkov  wrote:

> On Tue, Mar 12, 2013 at 11:11:24PM +0100, Tim W. wrote:
>> What does MAC stand for? If it's Apple, then MAC -> Mac ;-)
> 
> In this context it's Monkey's Audio Codec.

OK, thanks for the clarification.

Tim
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 2/3] ape: provide two additional bytes in buffer for old MAC versions

2013-03-12 Thread Kostya Shishkov
On Tue, Mar 12, 2013 at 11:11:24PM +0100, Tim W. wrote:
> What does MAC stand for? If it's Apple, then MAC -> Mac ;-)

In this context it's Monkey's Audio Codec.
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 2/3] ape: provide two additional bytes in buffer for old MAC versions

2013-03-12 Thread Tim W.
What does MAC stand for? If it's Apple, then MAC -> Mac ;-)

Tim

On Mar 12, 2013, at 8:08 PM, Kostya Shishkov  wrote:

> Range coder in 3.90-3.95 overread two bytes in the final normalize.
> ---
> libavcodec/apedec.c |4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c
> index 13d92e9..a46b040 100644
> --- a/libavcodec/apedec.c
> +++ b/libavcodec/apedec.c
> @@ -912,11 +912,13 @@ static int ape_decode_frame(AVCodecContext *avctx, void 
> *data,
> av_log(avctx, AV_LOG_WARNING, "packet size is not a multiple of 
> 4. "
>"extra bytes at the end will be skipped.\n");
> }
> -
> +if (s->fileversion < 3950) // previous versions overread two bytes
> +buf_size += 2;
> av_fast_malloc(&s->data, &s->data_size, buf_size);
> if (!s->data)
> return AVERROR(ENOMEM);
> s->dsp.bswap_buf((uint32_t*)s->data, (const uint32_t*)buf, buf_size 
> >> 2);
> +memset(s->data + (buf_size & ~3), 0, buf_size & 3);
> s->ptr = s->data;
> s->data_end = s->data + buf_size;
> 
> -- 
> 1.7.9.5
> 
> ___
> libav-devel mailing list
> libav-devel@libav.org
> https://lists.libav.org/mailman/listinfo/libav-devel

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 2/3] ape: provide two additional bytes in buffer for old MAC versions

2013-03-12 Thread Luca Barbato
On 12/03/13 20:08, Kostya Shishkov wrote:
> Range coder in 3.90-3.95 overread two bytes in the final normalize.
> ---
>  libavcodec/apedec.c |4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

Ok.

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


[libav-devel] [PATCH 2/3] ape: provide two additional bytes in buffer for old MAC versions

2013-03-12 Thread Kostya Shishkov
Range coder in 3.90-3.95 overread two bytes in the final normalize.
---
 libavcodec/apedec.c |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c
index 13d92e9..a46b040 100644
--- a/libavcodec/apedec.c
+++ b/libavcodec/apedec.c
@@ -912,11 +912,13 @@ static int ape_decode_frame(AVCodecContext *avctx, void 
*data,
 av_log(avctx, AV_LOG_WARNING, "packet size is not a multiple of 4. 
"
"extra bytes at the end will be skipped.\n");
 }
-
+if (s->fileversion < 3950) // previous versions overread two bytes
+buf_size += 2;
 av_fast_malloc(&s->data, &s->data_size, buf_size);
 if (!s->data)
 return AVERROR(ENOMEM);
 s->dsp.bswap_buf((uint32_t*)s->data, (const uint32_t*)buf, buf_size >> 
2);
+memset(s->data + (buf_size & ~3), 0, buf_size & 3);
 s->ptr = s->data;
 s->data_end = s->data + buf_size;
 
-- 
1.7.9.5

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel