aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-11-20 17:19:25 +0100
committerAnton Khirnov <anton@khirnov.net>2012-10-06 09:40:46 +0200
commit899d95efe12f1e250b361837c1c8c06df9ac9b86 (patch)
tree126d547904a0b03573539e2fde0b08fd187da1c7
parent8812b5f164109553f009ce385e17a1af16b6ea53 (diff)
downloadffmpeg-899d95efe12f1e250b361837c1c8c06df9ac9b86.tar.gz
mpegvideo: Don't use ff_mspel_motion() for vc1
Using ff_mspel_motion assumes that s (a MpegEncContext poiinter) really is a Wmv2Context. This fixes crashes in error resilience on vc1/wmv3 videos. CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st> (cherry picked from commit 18f2d5cb9c48d06895960f37467576725c9dc2d1) Signed-off-by: Anton Khirnov <anton@khirnov.net> (cherry picked from commit da0c457663479bc1828918e1bb3e4a5e4de0d557) Signed-off-by: Anton Khirnov <anton@khirnov.net>
-rw-r--r--libavcodec/mpegvideo_common.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/mpegvideo_common.h b/libavcodec/mpegvideo_common.h
index d0093ce8d2..dfedc6bade 100644
--- a/libavcodec/mpegvideo_common.h
+++ b/libavcodec/mpegvideo_common.h
@@ -725,7 +725,8 @@ static av_always_inline void MPV_motion_internal(MpegEncContext *s,
0, 0, 0,
ref_picture, pix_op, qpix_op,
s->mv[dir][0][0], s->mv[dir][0][1], 16);
- }else if(!is_mpeg12 && (CONFIG_WMV2_DECODER || CONFIG_WMV2_ENCODER) && s->mspel){
+ } else if (!is_mpeg12 && (CONFIG_WMV2_DECODER || CONFIG_WMV2_ENCODER) &&
+ s->mspel && s->codec_id == CODEC_ID_WMV2) {
ff_mspel_motion(s, dest_y, dest_cb, dest_cr,
ref_picture, pix_op,
s->mv[dir][0][0], s->mv[dir][0][1], 16);