diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-11-26 16:09:46 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-11-26 16:11:02 +0100 |
commit | a3f30f2e995c3d72664e28a43bec41c4b13ef909 (patch) | |
tree | 9efecd7da9820914fa354d31479a04ed2c745176 /libavcodec/flashsv.c | |
parent | 59b68ee8870ad7b831321ff39638660ac59e4a18 (diff) | |
parent | 5ae72f54532960cb9eae82a1c9e8d505106c022b (diff) | |
download | ffmpeg-a3f30f2e995c3d72664e28a43bec41c4b13ef909.tar.gz |
Merge commit '5ae72f54532960cb9eae82a1c9e8d505106c022b'
* commit '5ae72f54532960cb9eae82a1c9e8d505106c022b':
flashsv: check for keyframe before using differential coding
h264: enable low delay only if no delayed frames were seen
x86: fix build without inline asm
Conflicts:
libavcodec/h264.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/flashsv.c')
-rw-r--r-- | libavcodec/flashsv.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libavcodec/flashsv.c b/libavcodec/flashsv.c index 46a103b22c..1b65ecf6d1 100644 --- a/libavcodec/flashsv.c +++ b/libavcodec/flashsv.c @@ -379,6 +379,11 @@ static int flashsv_decode_frame(AVCodecContext *avctx, void *data, } if (has_diff) { + if (!s->keyframe) { + av_log(avctx, AV_LOG_ERROR, + "inter frame without keyframe\n"); + return AVERROR_INVALIDDATA; + } s->diff_start = get_bits(&gb, 8); s->diff_height = get_bits(&gb, 8); av_log(avctx, AV_LOG_DEBUG, @@ -405,10 +410,6 @@ static int flashsv_decode_frame(AVCodecContext *avctx, void *data, int k; int off = (s->image_height - y_pos - 1) * s->frame.linesize[0]; - if (!s->keyframe) { - av_log(avctx, AV_LOG_ERROR, "no keyframe yet\n"); - return AVERROR_INVALIDDATA; - } for (k = 0; k < cur_blk_height; k++) memcpy(s->frame.data[0] + off - k*s->frame.linesize[0] + x_pos*3, s->keyframe + off - k*s->frame.linesize[0] + x_pos*3, |