Avoid division by zero if h264 width and/or height is 0. (Happens on corrupt data)
This commit is contained in:
parent
46df6a2b72
commit
0cd90a8610
1 changed files with 5 additions and 3 deletions
|
@ -412,10 +412,12 @@ h264_decode_slice_header(th_stream_t *st, bitstream_t *bs, int *pkttype,
|
|||
|
||||
int w = p->sps[sps_id].aspect_num * st->st_width;
|
||||
int h = p->sps[sps_id].aspect_den * st->st_height;
|
||||
int d = gcd(w, h);
|
||||
|
||||
st->st_aspect_num = w / d;
|
||||
st->st_aspect_den = h / d;
|
||||
if(w & h) {
|
||||
int d = gcd(w, h);
|
||||
st->st_aspect_num = w / d;
|
||||
st->st_aspect_den = h / d;
|
||||
}
|
||||
|
||||
} else {
|
||||
st->st_aspect_num = 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue