Genesis 40:1-6 NLT

1 Some time later, Pharaoh's chief cup-bearer and chief baker offended him.
2 Pharaoh became very angry with these officials,
3 and he put them in the prison where Joseph was, in the palace of Potiphar, the captain of the guard.
4 They remained in prison for quite some time, and Potiphar assigned Joseph to take care of them.
5 One night the cup-bearer and the baker each had a dream, and each dream had its own meaning.
6 The next morning Joseph noticed the dejected look on their faces.