shithub: treason

Download patch

ref: a67d9836f66b1018dc4ae30bf67c4b7caeb413c1
parent: 05551a759c2aaa3752fa5bcecda550bfde1e896a
author: Sigrid Haflínudóttir <[email protected]>
date: Tue Sep 15 14:04:28 EDT 2020

h264: height needs to be 16-byte aligned as well

--- a/decoder_h264.c
+++ b/decoder_h264.c
@@ -48,8 +48,7 @@
 			}else if((f = malloc(sizeof(*f) + w*h*3)) != nil){
 				f->w = w;
 				f->h = h;
-				/* FIXME I have not a single idea what are these weird shifts based on image width */
-				yuv420_rgb24(w, h, pic, pic+w*h+w*8, pic+w*h*5/4+w*10, w, w/2, f->rgb, w*3);
+				yuv420_rgb24(w, h, pic, pic+w*h, pic+w*h*5/4, w, w/2, f->rgb, w*3);
 				f->dt = (sf.timestamp - lasttimestamp) * d->timebase * 1000000000ULL;
 				lasttimestamp = sf.timestamp;
 
@@ -68,6 +67,8 @@
 			}
 			if(w & 15)
 				w += 16 - (w & 15);
+			if(h & 15)
+				h += 16 - (h & 15);
 			break;
 
 		case H264BSD_RDY: