Remove some silly disabled code.
[ffmpeg.git] / libavcodec / h264.c
index a191bc7..5de7f10 100644 (file)
@@ -2773,7 +2773,6 @@ static int decode_slice_header(H264Context *h, H264Context *h0)
             }
         } else {
             /* Frame or first field in a potentially complementary pair */
-            assert(!s0->current_picture_ptr);
             s0->first_field = FIELD_PICTURE;
         }
 
@@ -3695,8 +3694,10 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size)
                         buf[buf_index + 2] == 1)
                         break;
 
-                if (buf_index + 3 >= buf_size)
+                if (buf_index + 3 >= buf_size) {
+                    buf_index = buf_size;
                     break;
+                }
 
                 buf_index += 3;
                 if (buf_index >= next_avc)
@@ -3876,7 +3877,8 @@ again:
 
                 if (avctx->bits_per_raw_sample != h->sps.bit_depth_luma ||
                     h->cur_chroma_format_idc   != h->sps.chroma_format_idc) {
-                    if (s->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU
+                    if (s->avctx->codec &&
+                        s->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU
                         && (h->sps.bit_depth_luma != 8 ||
                             h->sps.chroma_format_idc > 1)) {
                         av_log(avctx, AV_LOG_ERROR,