OSDN Git Service
(root)
/
android-x86
/
external-ffmpeg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6997141
)
lavc/pcm: clarify error message from pcm_decode_frame()
author
Stefano Sabatini
<stefasab@gmail.com>
Fri, 22 Jun 2012 15:43:40 +0000
(17:43 +0200)
committer
Stefano Sabatini
<stefasab@gmail.com>
Fri, 22 Jun 2012 22:42:51 +0000
(
00:42
+0200)
Extend/clarify an error message in case of invalid packet size, and
return a proper error message instead of -1.
Improve debuggability.
libavcodec/pcm.c
patch
|
blob
|
history
diff --git
a/libavcodec/pcm.c
b/libavcodec/pcm.c
index
c72b200
..
826267f
100644
(file)
--- 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;
}