summaryrefslogtreecommitdiff
path: root/libavcodec/h264.c
diff options
context:
space:
mode:
authorJeff Downs <heydowns@borg.com>2007-12-05 05:24:54 +0000
committerJeff Downs <heydowns@borg.com>2007-12-05 05:24:54 +0000
commitcf653d0811b1468089dbeea745e8019da0fc1e1c (patch)
tree91cd284e34af31f85787c15f6ca89da89a10a920 /libavcodec/h264.c
parent9de2919ce528d8b573ad9bbb99c96da6516b06d2 (diff)
Initialize function pointers used by error resilience code before any
potential error return from decode_slice_header. Fixes issue 284. Originally committed as revision 11168 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r--libavcodec/h264.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 809ce6c5ff..19d83197ad 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -3875,6 +3875,14 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
s->dropable= h->nal_ref_idc == 0;
+ if((s->avctx->flags2 & CODEC_FLAG2_FAST) && !h->nal_ref_idc){
+ s->me.qpel_put= s->dsp.put_2tap_qpel_pixels_tab;
+ s->me.qpel_avg= s->dsp.avg_2tap_qpel_pixels_tab;
+ }else{
+ s->me.qpel_put= s->dsp.put_h264_qpel_pixels_tab;
+ s->me.qpel_avg= s->dsp.avg_h264_qpel_pixels_tab;
+ }
+
first_mb_in_slice= get_ue_golomb(&s->gb);
if((s->flags2 & CODEC_FLAG2_CHUNKS) && first_mb_in_slice == 0){
@@ -4241,14 +4249,6 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
);
}
- if((s->avctx->flags2 & CODEC_FLAG2_FAST) && !h->nal_ref_idc){
- s->me.qpel_put= s->dsp.put_2tap_qpel_pixels_tab;
- s->me.qpel_avg= s->dsp.avg_2tap_qpel_pixels_tab;
- }else{
- s->me.qpel_put= s->dsp.put_h264_qpel_pixels_tab;
- s->me.qpel_avg= s->dsp.avg_h264_qpel_pixels_tab;
- }
-
return 0;
}