OSDN Git Service
(root)
/
coroid
/
libav_saccubus.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b408317
)
Do not discard truncated packets.
author
Michael Niedermayer
<michaelni@gmx.at>
Sun, 19 Apr 2009 20:40:56 +0000
(20:40 +0000)
committer
Michael Niedermayer
<michaelni@gmx.at>
Sun, 19 Apr 2009 20:40:56 +0000
(20:40 +0000)
Based on a patch by Maksym Veremeyenko verem DOT m1stereo AT tv
Originally committed as revision 18626 to svn://svn.ffmpeg.org/ffmpeg/trunk
libavcodec/pcm.c
patch
|
blob
|
history
diff --git
a/libavcodec/pcm.c
b/libavcodec/pcm.c
index
ca42b53
..
beb831b
100644
(file)
--- a/
libavcodec/pcm.c
+++ b/
libavcodec/pcm.c
@@
-361,8
+361,11
@@
static int pcm_decode_frame(AVCodecContext *avctx,
n = avctx->channels * sample_size;
if(n && buf_size % n){
+ if (buf_size < n) {
av_log(avctx, AV_LOG_ERROR, "invalid PCM packet\n");
return -1;
+ }else
+ buf_size -= buf_size % n;
}
buf_size= FFMIN(buf_size, *data_size/2);