Browse Source

h264: do not call field_end if we do not have a current picture

Fixes invalid reads.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
tags/n2.2-rc1
Anton Khirnov 12 years ago
parent
commit
00dbff4c3e
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavcodec/h264.c

+ 1
- 1
libavcodec/h264.c View File

@@ -3348,7 +3348,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0)
first_mb_in_slice = get_ue_golomb(&h->gb); first_mb_in_slice = get_ue_golomb(&h->gb);


if (first_mb_in_slice == 0) { // FIXME better field boundary detection if (first_mb_in_slice == 0) { // FIXME better field boundary detection
if (h0->current_slice && FIELD_PICTURE(h)) {
if (h0->current_slice && h->cur_pic_ptr && FIELD_PICTURE(h)) {
field_end(h, 1); field_end(h, 1);
} }




Loading…
Cancel
Save