diff options
author | Anton Khirnov <anton@khirnov.net> | 2013-11-01 18:07:22 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2013-11-18 18:09:48 +0100 |
commit | a553c6a347d3d28d7ee44c3df3d5c4ee780dba23 (patch) | |
tree | d7f3a20b6d439d56d5bf5856f47f8da5652e820b /libavcodec/h264_refs.c | |
parent | cc20fbcd39c7b60602edae4f7deb092ecfd3c975 (diff) | |
download | ffmpeg-a553c6a347d3d28d7ee44c3df3d5c4ee780dba23.tar.gz |
lavc: use buf[0] instead of data[0] in checks whether a frame is allocated
data[0] may be NULL for valid frames with hwaccel pixel formats.
Diffstat (limited to 'libavcodec/h264_refs.c')
-rw-r--r-- | libavcodec/h264_refs.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libavcodec/h264_refs.c b/libavcodec/h264_refs.c index 3721c2e337..5a09c2ccc5 100644 --- a/libavcodec/h264_refs.c +++ b/libavcodec/h264_refs.c @@ -140,7 +140,9 @@ int ff_h264_fill_default_ref_list(H264Context *h) } if (lens[0] == lens[1] && lens[1] > 1) { - for (i = 0; h->default_ref_list[0][i].f.data[0] == h->default_ref_list[1][i].f.data[0] && i < lens[0]; i++); + for (i = 0; i < lens[0] && + h->default_ref_list[0][i].f.buf[0]->buffer == + h->default_ref_list[1][i].f.buf[0]->buffer; i++); if (i == lens[0]) { Picture tmp; COPY_PICTURE(&tmp, &h->default_ref_list[1][0]); @@ -303,9 +305,9 @@ int ff_h264_decode_ref_pic_list_reordering(H264Context *h) } for (list = 0; list < h->list_count; list++) { for (index = 0; index < h->ref_count[list]; index++) { - if (!h->ref_list[list][index].f.data[0]) { + if (!h->ref_list[list][index].f.buf[0]) { av_log(h->avctx, AV_LOG_ERROR, "Missing reference picture\n"); - if (h->default_ref_list[list][0].f.data[0]) + if (h->default_ref_list[list][0].f.buf[0]) COPY_PICTURE(&h->ref_list[list][index], &h->default_ref_list[list][0]); else return -1; |