diff -uNr ffmpeg-0.4.9-pre1-org/libavcodec/utils.c ffmpeg-0.4.9-pre1/libavcodec/utils.c --- ffmpeg-0.4.9-pre1-org/libavcodec/utils.c 2006-03-02 17:52:33.000000000 +0900 +++ ffmpeg-0.4.9-pre1/libavcodec/utils.c 2006-03-02 18:40:12.000000000 +0900 @@ -520,6 +520,10 @@ { int ret; + if (buf_size <= 0) { + return 0; + } + *frame_size_ptr= 0; ret = avctx->codec->decode(avctx, samples, frame_size_ptr, buf, buf_size);