mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-28 04:31:06 +00:00
libs: decoder: h265: check for null
Coverity scan bug: Dereference after null check: Either the check against null is unnecessary, or there may be a null pointer dereference. While looking for hte lowest poc, according to rest of the code, the picture in the dbp (decoded picture buffer) might be NULL, thus we could check for a NULL picture before assigned as found. Also, split a comma operator because it is considered as a bad practice because it possible side effects.
This commit is contained in:
parent
d879664a0a
commit
067968ae74
1 changed files with 4 additions and 2 deletions
|
@ -717,8 +717,10 @@ dpb_find_lowest_poc (GstVaapiDecoderH265 * decoder,
|
|||
GstVaapiPictureH265 *const picture = priv->dpb[i]->buffer;
|
||||
if (picture && !picture->output_needed)
|
||||
continue;
|
||||
if (!found_picture || found_picture->poc > picture->poc)
|
||||
found_picture = picture, found_index = i;
|
||||
if (picture && (!found_picture || found_picture->poc > picture->poc)) {
|
||||
found_picture = picture;
|
||||
found_index = i;
|
||||
}
|
||||
}
|
||||
|
||||
if (found_picture_ptr)
|
||||
|
|
Loading…
Reference in a new issue