[FFmpeg-cvslog] dpcm: return error if packet is too small

Justin Ruggles git at videolan.org
Sat Oct 1 03:06:43 CEST 2011


ffmpeg | branch: master | Justin Ruggles <justin.ruggles at gmail.com> | Sun Sep 11 13:18:51 2011 -0400| [08bd22a61b820160bff5f98cd51d2e0135d02e00] | committer: Justin Ruggles

dpcm: return error if packet is too small

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=08bd22a61b820160bff5f98cd51d2e0135d02e00
---

 libavcodec/dpcm.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/libavcodec/dpcm.c b/libavcodec/dpcm.c
index d4cf806..6ba8ab1 100644
--- a/libavcodec/dpcm.c
+++ b/libavcodec/dpcm.c
@@ -201,7 +201,10 @@ static int dpcm_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
         break;
     }
     out *= av_get_bytes_per_sample(avctx->sample_fmt);
-
+    if (out < 0) {
+        av_log(avctx, AV_LOG_ERROR, "packet is too small\n");
+        return AVERROR(EINVAL);
+    }
     if (*data_size < out) {
         av_log(avctx, AV_LOG_ERROR, "output buffer is too small\n");
         return AVERROR(EINVAL);



More information about the ffmpeg-cvslog mailing list