Skip to content

Commit

Permalink
h264: do not call field_end if we do not have a current picture
Browse files Browse the repository at this point in the history
Fixes invalid reads.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
  • Loading branch information
elenril committed Jan 18, 2014
1 parent 7f0e81d commit 00dbff4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libavcodec/h264.c
Expand Up @@ -3348,7 +3348,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0)
first_mb_in_slice = get_ue_golomb(&h->gb);

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);
}

Expand Down

0 comments on commit 00dbff4

Please sign in to comment.