[FFmpeg-devel] [PATCH] libshine: fix support for shine 3.0

Andreas Cadhalpun andreas.cadhalpun at googlemail.com
Sun May 24 15:52:21 CEST 2015

shine_encode_buffer expects written to be an int pointer, while the
previous shine_encode_frame expected it to be a long pointer.

Thus encoding with libshine currently always fails with
"internal buffer too small", because a negative return value of
shine_encode_buffer is interpreted as a very large long value.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
 libavcodec/libshine.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/libshine.c b/libavcodec/libshine.c
index 48333bb..27c1a5f 100644
--- a/libavcodec/libshine.c
+++ b/libavcodec/libshine.c
@@ -71,7 +71,7 @@ static int libshine_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
     SHINEContext *s = avctx->priv_data;
     MPADecodeHeader hdr;
     unsigned char *data;
-    long written;
+    int written;
     int ret, len;
     if (frame)

More information about the ffmpeg-devel mailing list