aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorDerek Buitenhuis <derek.buitenhuis@gmail.com>2016-05-17 15:18:43 +0100
committerDerek Buitenhuis <derek.buitenhuis@gmail.com>2016-05-17 15:18:43 +0100
commitd55568d22a5a6e59c087b8614227d5a0a3da4164 (patch)
tree87c1c378d7497f828a2d560759e6189b948f82ee /libavcodec
parent278dcec28db8f309cf202b002966f06b9d275248 (diff)
parent71d3305c2711d4f6ec8b92db09ff64cf4e19a58e (diff)
downloadffmpeg-d55568d22a5a6e59c087b8614227d5a0a3da4164.tar.gz
Merge commit '71d3305c2711d4f6ec8b92db09ff64cf4e19a58e'
* commit '71d3305c2711d4f6ec8b92db09ff64cf4e19a58e': h264_parse: make sure the ref count is zeroed on all failure paths Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/h264_parse.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libavcodec/h264_parse.c b/libavcodec/h264_parse.c
index 5153ddc586..4f125b56a1 100644
--- a/libavcodec/h264_parse.c
+++ b/libavcodec/h264_parse.c
@@ -218,7 +218,7 @@ int ff_h264_parse_ref_count(int *plist_count, int ref_count[2],
ref_count[0] - 1, max[0], ref_count[1] - 1, max[1]);
ref_count[0] = ref_count[1] = 0;
*plist_count = 0;
- return AVERROR_INVALIDDATA;
+ goto fail;
}
if (slice_type_nos == AV_PICTURE_TYPE_B)
@@ -233,4 +233,9 @@ int ff_h264_parse_ref_count(int *plist_count, int ref_count[2],
*plist_count = list_count;
return 0;
+fail:
+ *plist_count = 0;
+ ref_count[0] = 0;
+ ref_count[1] = 0;
+ return AVERROR_INVALIDDATA;
}