wmalosslessdec: reset frame->nb_samples on packet loss
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Thu, 2 Jul 2015 22:02:44 +0000 (00:02 +0200)
committerAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Tue, 7 Jul 2015 21:35:00 +0000 (23:35 +0200)
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>
libavcodec/wmalosslessdec.c

index 8094db3..0c85c83 100644 (file)
@@ -1005,6 +1005,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++) {