Commit f24b7d76 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '28fb80dc'

* commit '28fb80dc':
  svq1: Check memory allocation

Conflicts:
	libavcodec/svq1enc.c

See: 2a3af772Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents abee1972 28fb80dc
...@@ -556,8 +556,8 @@ static av_cold int svq1_encode_init(AVCodecContext *avctx) ...@@ -556,8 +556,8 @@ static av_cold int svq1_encode_init(AVCodecContext *avctx)
s->y_block_height * sizeof(int32_t)); s->y_block_height * sizeof(int32_t));
s->ssd_int8_vs_int16 = ssd_int8_vs_int16_c; s->ssd_int8_vs_int16 = ssd_int8_vs_int16_c;
if (!s->m.me.scratchpad || !s->m.me.map || !s->m.me.score_map || if (!s->m.me.temp || !s->m.me.scratchpad || !s->m.me.map ||
!s->mb_type || !s->dummy) { !s->m.me.score_map || !s->mb_type || !s->dummy) {
svq1_encode_end(avctx); svq1_encode_end(avctx);
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
} }
...@@ -622,8 +622,15 @@ static int svq1_encode_frame(AVCodecContext *avctx, AVPacket *pkt, ...@@ -622,8 +622,15 @@ static int svq1_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
s->frame_width / (i ? 4 : 1), s->frame_width / (i ? 4 : 1),
s->frame_height / (i ? 4 : 1), s->frame_height / (i ? 4 : 1),
pict->linesize[i], pict->linesize[i],
s->current_picture->linesize[i]) < 0) s->current_picture->linesize[i]) < 0) {
int j;
for (j = 0; j < i; j++) {
av_freep(&s->motion_val8[j]);
av_freep(&s->motion_val16[j]);
}
av_freep(&s->scratchbuf);
return -1; return -1;
}
// avpriv_align_put_bits(&s->pb); // avpriv_align_put_bits(&s->pb);
while (put_bits_count(&s->pb) & 31) while (put_bits_count(&s->pb) & 31)
......
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