[FFmpeg-cvslog] avcodec/huffyuvenc: fail if stats_out is too small instead of silently truncating
Michael Niedermayer
git at videolan.org
Sun Jan 26 17:50:15 CET 2014
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Jan 26 16:23:45 2014 +0100| [a301bb63f05d0fa41e9dc9142b9a4e96ac5d5a64] | committer: Michael Niedermayer
avcodec/huffyuvenc: fail if stats_out is too small instead of silently truncating
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a301bb63f05d0fa41e9dc9142b9a4e96ac5d5a64
---
libavcodec/huffyuvenc.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libavcodec/huffyuvenc.c b/libavcodec/huffyuvenc.c
index d01ca9c..68f6903 100644
--- a/libavcodec/huffyuvenc.c
+++ b/libavcodec/huffyuvenc.c
@@ -947,6 +947,8 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
}
snprintf(p, end-p, "\n");
p++;
+ if (end <= p)
+ return AVERROR(ENOMEM);
}
} else
avctx->stats_out[0] = '\0';
More information about the ffmpeg-cvslog
mailing list