Commit e8a2f8cc authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '58b68e4f'

* commit '58b68e4f':
  proresenc: Report buffer overflow

Conflicts:
	libavcodec/proresenc_kostya.c

See: 52b81ff4Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 43b769b0 58b68e4f
...@@ -570,9 +570,9 @@ static int encode_slice(AVCodecContext *avctx, const AVFrame *pic, ...@@ -570,9 +570,9 @@ static int encode_slice(AVCodecContext *avctx, const AVFrame *pic,
} }
total_size += sizes[i]; total_size += sizes[i];
if (put_bits_left(pb) < 0) { if (put_bits_left(pb) < 0) {
av_log(avctx, AV_LOG_ERROR, "Serious underevaluation of" av_log(avctx, AV_LOG_ERROR,
"required buffer size"); "Underestimated required buffer size.\n");
return AVERROR_BUFFER_TOO_SMALL; return AVERROR_BUG;
} }
} }
return total_size; return total_size;
...@@ -1023,7 +1023,8 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, ...@@ -1023,7 +1023,8 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
slice_hdr = buf; slice_hdr = buf;
buf += slice_hdr_size - 1; buf += slice_hdr_size - 1;
init_put_bits(&pb, buf, (pkt_size - (buf - orig_buf)) * 8); init_put_bits(&pb, buf, (pkt_size - (buf - orig_buf)) * 8);
ret = encode_slice(avctx, pic, &pb, sizes, x, y, q, mbs_per_slice); ret = encode_slice(avctx, pic, &pb, sizes, x, y, q,
mbs_per_slice);
if (ret < 0) if (ret < 0)
return ret; return ret;
......
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