diff options
author | Stefano Sabatini <stefasab@gmail.com> | 2012-06-22 17:43:40 +0200 |
---|---|---|
committer | Stefano Sabatini <stefasab@gmail.com> | 2012-06-23 00:42:51 +0200 |
commit | 201b409da0d81dce19caa1393fe1c9f8e17aeb92 (patch) | |
tree | fbe8889f8e477680a96ac18e4a1560890c19d1ad /libavcodec/pcm.c | |
parent | 69971410f9d9fdf5bc6e7cbe73d917155ea442ce (diff) | |
download | ffmpeg-streaming-201b409da0d81dce19caa1393fe1c9f8e17aeb92.zip ffmpeg-streaming-201b409da0d81dce19caa1393fe1c9f8e17aeb92.tar.gz |
lavc/pcm: clarify error message from pcm_decode_frame()
Extend/clarify an error message in case of invalid packet size, and
return a proper error message instead of -1.
Improve debuggability.
Diffstat (limited to 'libavcodec/pcm.c')
-rw-r--r-- | libavcodec/pcm.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/pcm.c b/libavcodec/pcm.c index c72b200..826267f 100644 --- a/libavcodec/pcm.c +++ b/libavcodec/pcm.c @@ -293,8 +293,10 @@ static int pcm_decode_frame(AVCodecContext *avctx, void *data, if (n && buf_size % n) { if (buf_size < n) { - av_log(avctx, AV_LOG_ERROR, "invalid PCM packet\n"); - return -1; + av_log(avctx, AV_LOG_ERROR, + "Invalid PCM packet, data has size %d but at least a size of %d was expected\n", + buf_size, n); + return AVERROR_INVALIDDATA; } else buf_size -= buf_size % n; } |