aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2015-07-03 00:02:44 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2015-07-28 02:42:15 +0200
commitdcfd83fb8e3c115cd294ae80304db10f7085efe9 (patch)
tree32ad47caedd7344bd12641bd05501a339e84b7d7
parent29a97823ba7c534d88ff414394a85f6d36ab6434 (diff)
downloadffmpeg-dcfd83fb8e3c115cd294ae80304db10f7085efe9.tar.gz
wmalosslessdec: reset frame->nb_samples on packet loss
Otherwise a frame with non-zero nb_samples but without any data can be returned. Reviewed-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> (cherry picked from commit 42e7a5b3c704985c2c18970cc94a837b413df9d9) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/wmalosslessdec.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libavcodec/wmalosslessdec.c b/libavcodec/wmalosslessdec.c
index ee4eb03bc6..72535d5030 100644
--- a/libavcodec/wmalosslessdec.c
+++ b/libavcodec/wmalosslessdec.c
@@ -1028,6 +1028,7 @@ static int decode_frame(WmallDecodeCtx *s)
if ((ret = ff_get_buffer(s->avctx, s->frame, 0)) < 0) {
/* return an error if no frame could be decoded at all */
s->packet_loss = 1;
+ s->frame->nb_samples = 0;
return ret;
}
for (i = 0; i < s->num_channels; i++) {