Mercurial > libavcodec.hg
comparison h264.c @ 6016:5455f4e43948 libavcodec
Make h264 decoder conform to requirements of mpegvideo's MPV_frame_start.
Namely, that it should not be called if you are starting to decode a B
frame without any reference pictures.
Prevents an endless allocation cycle in MPV_frame_start that will end in
picture buffer overflow and abort.
Fixes roundup issue 216.
author | heydowns |
---|---|
date | Fri, 14 Dec 2007 05:37:23 +0000 |
parents | 33b0514769b2 |
children | e1404acccac3 |
comparison
equal
deleted
inserted
replaced
6015:bb4f24c580f5 | 6016:5455f4e43948 |
---|---|
3909 default_ref_list_done = 1; | 3909 default_ref_list_done = 1; |
3910 } | 3910 } |
3911 h->slice_type= slice_type; | 3911 h->slice_type= slice_type; |
3912 | 3912 |
3913 s->pict_type= h->slice_type; // to make a few old func happy, it's wrong though | 3913 s->pict_type= h->slice_type; // to make a few old func happy, it's wrong though |
3914 if (s->pict_type == B_TYPE && s->last_picture_ptr == NULL) { | |
3915 av_log(h->s.avctx, AV_LOG_ERROR, | |
3916 "B picture before any references, skipping\n"); | |
3917 return -1; | |
3918 } | |
3914 | 3919 |
3915 pps_id= get_ue_golomb(&s->gb); | 3920 pps_id= get_ue_golomb(&s->gb); |
3916 if(pps_id>=MAX_PPS_COUNT){ | 3921 if(pps_id>=MAX_PPS_COUNT){ |
3917 av_log(h->s.avctx, AV_LOG_ERROR, "pps_id out of range\n"); | 3922 av_log(h->s.avctx, AV_LOG_ERROR, "pps_id out of range\n"); |
3918 return -1; | 3923 return -1; |