Commit 27216bf3 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/libtheoraenc: Check for stats allocation failure

Fixes CID1257785
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 20f5a179
...@@ -131,6 +131,10 @@ static int submit_stats(AVCodecContext *avctx) ...@@ -131,6 +131,10 @@ static int submit_stats(AVCodecContext *avctx)
} }
h->stats_size = strlen(avctx->stats_in) * 3/4; h->stats_size = strlen(avctx->stats_in) * 3/4;
h->stats = av_malloc(h->stats_size); h->stats = av_malloc(h->stats_size);
if (!h->stats) {
h->stats_size = 0;
return AVERROR(ENOMEM);
}
h->stats_size = av_base64_decode(h->stats, avctx->stats_in, h->stats_size); h->stats_size = av_base64_decode(h->stats, avctx->stats_in, h->stats_size);
} }
while (h->stats_size - h->stats_offset > 0) { while (h->stats_size - h->stats_offset > 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment